<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.geeek.org/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>Blog de Geeek, le blog geek par excellence par Ludovic Toinel ... - performance</title>
  <link>http://www.geeek.org/</link>
  <description>Le blog d'un geek passionné par : l'informatique, le Web, Internet, les gadgets, la photo, la sécurité, Linux, la culture geek ...</description>
  <language>fr</language>
  <pubDate>Fri, 04 Jul 2008 02:04:18 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Highscalability.com : Astuces de performance et scalabilité pour les architectes du Web</title>
    <link>http://www.geeek.org/post/2008/05/24/Highscalabilitycom-%3A-Astuces-de-performance-et-scalabilite-pour-les-architectes-du-Web</link>
    <guid isPermaLink="false">urn:md5:775ea390a61a1dcfc8d857dccddb9f6f</guid>
    <pubDate>Sat, 24 May 2008 17:50:00 +0200</pubDate>
    <dc:creator>Ludovic Toinel</dc:creator>
        <category>Developpement</category>
        <category>architecture</category><category>informatique</category><category>performance</category><category>web</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.geeek.org/public/developpement/world.png&quot; alt=&quot;performance,scalability&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Voici &lt;a href=&quot;http://highscalability.com&quot;&gt;un site&lt;/a&gt; très intéressant qui
passionnera plus d'un d'entre vous. Il s'agit de &lt;a href=&quot;http://highscalability.com&quot;&gt;Hightscalability.com&lt;/a&gt;, un site qui détaille les
choix d'architecture des plates-formes sur le Web, tel que &lt;a href=&quot;http://highscalability.com/scaling-twitter-making-twitter-10000-percent-faster&quot;&gt;
Twitter&lt;/a&gt;, &lt;a href=&quot;http://highscalability.com/amazon-architecture&quot;&gt;Amazon&lt;/a&gt;, &lt;a href=&quot;http://highscalability.com/ebay-architecture&quot;&gt;eBay&lt;/a&gt; ....&lt;/p&gt;
&lt;p&gt;Les articles sont synthétiques et factuels, les éléments fournis dans les
rubriques &amp;quot;Lesson Learned&amp;quot; sont vraiment très intéressants et recroisent
énormément les problématiques que j'ai pu rencontrer sur des chantiers de
performances.&lt;/p&gt;
&lt;p&gt;Pour répondre à des besoins de scalabilité et de performance, il est
indispensable de faire travailler des architectes dès le &lt;strong&gt;début&lt;/strong&gt;
d'un projet. Il faut prévoir la scalabilité de l'application dès le début de la
conception, tout en prenant compte les contraintes techniques liées à
l'hébergement, les contraintes de budget et les contraintes de ressources.&lt;/p&gt;
&lt;p&gt;L'essentiel pour un architecte est de maîtriser les flux d'informations, de
comprendre quelles données sont nécessaires à l'exécution des Use-case de
l'application, quelle est la volatilité de ces données et les impacts qu'elles
ont sur le service fourni à l'utilisateur. Une fois cette maîtrise, la seconde
étape est de mettre en cache toutes les données qui peuvent être mises en
cache.&lt;/p&gt;
&lt;p&gt;Enfin, un autre point important est de mettre dès le début d'un projet les
outils de mesure de performance et de détection d'erreurs afin qu'une
évaluation des performances de l'application puisse être faite le plus tôt
possible. L'autre point important est d'accompagner les équipes d'intégration
afin qu'ils puissent évaluer la performance de l'ensemble de l'application.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://highscalability.com/&quot;&gt;http://highscalability.com/&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.geeek.org/post/2008/05/24/Highscalabilitycom-%3A-Astuces-de-performance-et-scalabilite-pour-les-architectes-du-Web#comment-form</comments>
      <wfw:comment>http://www.geeek.org/post/2008/05/24/Highscalabilitycom-%3A-Astuces-de-performance-et-scalabilite-pour-les-architectes-du-Web#comment-form</wfw:comment>
      <wfw:commentRss>http://www.geeek.org/feed/rss2/comments/1486</wfw:commentRss>
      </item>
    
  <item>
    <title>Top Blogs High-Tech : Respect des normes W3C et Performances</title>
    <link>http://www.geeek.org/post/2008/01/16/Top-Blogs-High-Tech-%3A-Respect-des-normes-W3C-et-Performance</link>
    <guid isPermaLink="false">urn:md5:f9e4714961652c767ce707af4b836fc2</guid>
    <pubDate>Wed, 16 Jan 2008 22:55:00 +0100</pubDate>
    <dc:creator>Ludovic Toinel</dc:creator>
        <category>Blogosphere</category>
        <category>blog</category><category>performance</category><category>top</category><category>w3c</category>    
    <description>    &lt;p&gt;Je me suis amusé à faire un re-classement des &lt;a href=&quot;http://www.wikio.fr/blogs/top/high-tech&quot; hreflang=&quot;fr&quot;&gt;10 top blogs High-Tech
sur Wikio&lt;/a&gt; du mois de janvier en fonction de différents critères
techniques.&lt;/p&gt;
&lt;h4&gt;Mes critères&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Temps de chargement de la Home Page (&lt;a href=&quot;https://addons.mozilla.org/fr/firefox/addon/1843&quot; hreflang=&quot;fr&quot;&gt;Firebug&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Nombre d'erreurs de validation XHTML (&lt;a href=&quot;https://addons.mozilla.org/fr/firefox/addon/249&quot; hreflang=&quot;fr&quot;&gt;HTML
Validator&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Environnement des tests&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Firefox 2.0.0.11&lt;/li&gt;
&lt;li&gt;ADSL Free en mode Patate&lt;/li&gt;
&lt;li&gt;CTRL+F5 avant chaque mesure pour purger le cache du navigateur&lt;/li&gt;
&lt;li&gt;Les mesures prennent compte des composants externes embarqués sur le blog
(pub, javascript de tracking ... ).&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Classement Wikio&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.techcrunch.com/&quot; hreflang=&quot;fr&quot;&gt;TechCrunch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.presse-citron.net/&quot; hreflang=&quot;fr&quot;&gt;Presse-citron&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fredcavazza.net/&quot; hreflang=&quot;fr&quot;&gt;FredCavazza&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.kelblog.com/&quot; hreflang=&quot;fr&quot;&gt;Kelblog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.mashable.com/&quot; hreflang=&quot;fr&quot;&gt;Mashable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.loiclemeur.com/france&quot; hreflang=&quot;fr&quot;&gt;Loïc le
Meur&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pisani.blog.lemonde.fr/&quot; hreflang=&quot;fr&quot;&gt;Transnets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.guim.fr/blog&quot; hreflang=&quot;fr&quot;&gt;GuiM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.2803.com/&quot; hreflang=&quot;fr&quot;&gt;2803 by Henri Labarre&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.accessoweb.info/&quot; hreflang=&quot;fr&quot;&gt;AccessOWeb
2.0&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Classement &amp;quot;Performance&amp;quot;&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fredcavazza.net/&quot; hreflang=&quot;fr&quot;&gt;FredCavazza&lt;/a&gt; (4,46
sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.presse-citron.net/&quot; hreflang=&quot;fr&quot;&gt;Presse-citron&lt;/a&gt;
(5,81 sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.2803.com/&quot; hreflang=&quot;fr&quot;&gt;2803 by Henri Labarre&lt;/a&gt; (6,4
sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.accessoweb.info/&quot; hreflang=&quot;fr&quot;&gt;AccessOWeb 2.0&lt;/a&gt;
(8,2 sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pisani.blog.lemonde.fr/&quot; hreflang=&quot;fr&quot;&gt;Transnets&lt;/a&gt; (7,49
sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.kelblog.com/&quot; hreflang=&quot;fr&quot;&gt;Kelblog&lt;/a&gt;
(12,71sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.techcrunch.com/&quot; hreflang=&quot;fr&quot;&gt;TechCrunch&lt;/a&gt; (15,5
sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.mashable.com/&quot; hreflang=&quot;fr&quot;&gt;Mashable&lt;/a&gt; (13,64
sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.loiclemeur.com/france&quot; hreflang=&quot;fr&quot;&gt;Loïc le Meur&lt;/a&gt;
(18,74 sec.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.guim.fr/blog&quot; hreflang=&quot;fr&quot;&gt;GuiM&lt;/a&gt; (34,07 sec.)&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Classement &amp;quot;Qualité du XHTML&amp;quot;&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://www.2803.com/&quot; hreflang=&quot;fr&quot;&gt;2803 by Henri Labarre&lt;/a&gt; (11
erreurs / 0 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fredcavazza.net/&quot; hreflang=&quot;fr&quot;&gt;FredCavazza&lt;/a&gt; (13
erreurs / 0 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.presse-citron.net/&quot; hreflang=&quot;fr&quot;&gt;Presse-citron&lt;/a&gt; (15
erreurs / 1 avertissement)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.kelblog.com/&quot; hreflang=&quot;fr&quot;&gt;Kelblog&lt;/a&gt; (30 erreurs / 0
avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.accessoweb.info/&quot; hreflang=&quot;fr&quot;&gt;AccessOWeb 2.0&lt;/a&gt; (37
erreurs / 5 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.loiclemeur.com/france&quot; hreflang=&quot;fr&quot;&gt;Loïc le Meur&lt;/a&gt;
(90 erreurs / 16 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pisani.blog.lemonde.fr/&quot; hreflang=&quot;fr&quot;&gt;Transnets&lt;/a&gt; (92
erreurs / 2 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.techcrunch.com/&quot; hreflang=&quot;fr&quot;&gt;TechCrunch&lt;/a&gt; (101
erreurs / 14 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.mashable.com/&quot; hreflang=&quot;fr&quot;&gt;Mashable&lt;/a&gt; (104 erreurs /
4 avertissements)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.guim.fr/blog&quot; hreflang=&quot;fr&quot;&gt;GuiM&lt;/a&gt; (127 erreurs / 6
avertissements)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bravo à Fredcavazza, Presse-citron et 2803 !&lt;/strong&gt; &lt;img src=&quot;/themes/geeek.org/smilies/wink.png&quot; alt=&quot;;-)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Des commentaires sur ce classement ?&lt;/p&gt;
&lt;p&gt;Et votre blog ? Quelle position a-t'il sur ces mêmes
critères ?&lt;/p&gt;</description>
    
    
    
          <comments>http://www.geeek.org/post/2008/01/16/Top-Blogs-High-Tech-%3A-Respect-des-normes-W3C-et-Performance#comment-form</comments>
      <wfw:comment>http://www.geeek.org/post/2008/01/16/Top-Blogs-High-Tech-%3A-Respect-des-normes-W3C-et-Performance#comment-form</wfw:comment>
      <wfw:commentRss>http://www.geeek.org/feed/rss2/comments/1225</wfw:commentRss>
      </item>
    
  <item>
    <title>Plugin Dotclear2 :  Performance</title>
    <link>http://www.geeek.org/post/2007/12/17/Plugin-Dotclear2-%3A-Performance</link>
    <guid isPermaLink="false">urn:md5:095ab56267e4337f01fa655aa54a9c02</guid>
    <pubDate>Mon, 17 Dec 2007 23:58:00 +0100</pubDate>
    <dc:creator>Ludovic Toinel</dc:creator>
        <category>DotClear</category>
        <category>dotclear</category><category>performance</category><category>plugin</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.geeek.org/public/images/dotclear.png&quot; alt=&quot;dotclear&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Voici un nouveau plugin qui affiche à vos visiteurs le temps de génération
de la page par Dotclear2. Pour voir le résultat de ce plugin, lisez la dernière
ligne de cette page Web.&lt;/p&gt;
&lt;h4&gt;Comment ça marche ?&lt;/h4&gt;
&lt;p&gt;C'est simple, un chrono est lancé dès la réception de la requête HTTP par
Dotclear. Ensuite un tag permet d'afficher en bas de page le temps total de la
génération de la page demandée.&lt;/p&gt;
&lt;h4&gt;Installer le plugin&lt;/h4&gt;
&lt;p&gt;Après avoir installé ce plugin, éditez le fichier &amp;quot;index.php&amp;quot; qui se trouve
à la racine de votre blog, et ajouter la ligne suivante :&lt;/p&gt;
&lt;code class=&quot;php&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$time_start&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/microtime&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;microtime&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;p&gt;Juste en dessus de :&lt;/p&gt;
&lt;code class=&quot;php&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'DC_BLOG_ID'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Ensuite, éditez le fichier &amp;quot;_footer.html&amp;quot; de votre thème et placez la ligne
suivante :&lt;/p&gt;
&lt;code class=&quot;xml&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;p&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;{{tpl:lang Powered by}} &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;href&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.dotclear.net/&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;DotClear 2&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/a&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; en &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;b&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;{{tpl:performance}}&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/b&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; sec.&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/p&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;h4&gt;Télécharger le plugin&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Package : &lt;a href=&quot;http://www.geeek.org/share/plugin-performance-0.1.pkg.gz&quot; hreflang=&quot;fr&quot;&gt;http://www.geeek.org/share/plugin-performance-0.1.pkg.gz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Archive : &lt;a href=&quot;http://www.geeek.org/share/plugin-performance-0.1.tar.gz&quot; hreflang=&quot;fr&quot;&gt;http://www.geeek.org/share/plugin-performance-0.1.tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Liste des mises à jour :&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;v0.1 :&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Première release.&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.geeek.org/post/2007/12/17/Plugin-Dotclear2-%3A-Performance#comment-form</comments>
      <wfw:comment>http://www.geeek.org/post/2007/12/17/Plugin-Dotclear2-%3A-Performance#comment-form</wfw:comment>
      <wfw:commentRss>http://www.geeek.org/feed/rss2/comments/1144</wfw:commentRss>
      </item>
    
  <item>
    <title>Optimisation de Dotclear 2 Beta 7 :  La face cachée de la base de données</title>
    <link>http://www.geeek.org/post/2007/11/18/Optimisation-de-Dotclear-2-Beta-7-%3A-La-face-cachee-de-la-base-de-donnees</link>
    <guid isPermaLink="false">urn:md5:0657d7402a0008d18dd084540117856d</guid>
    <pubDate>Sun, 18 Nov 2007 18:39:00 +0100</pubDate>
    <dc:creator>Ludovic Toinel</dc:creator>
        <category>DotClear</category>
        <category>base de données</category><category>dotclear2</category><category>hack</category><category>performance</category><category>sql</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.geeek.org/public/images/dotclear.png&quot; alt=&quot;dotclear2,sql,performance&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Après &lt;a href=&quot;http://www.geeek.org/post/2007/08/08/Tuning-Dotclear2-et-Apache&quot; hreflang=&quot;fr&quot;&gt;mon précédent article concernant quelques pistes d'optimisations de
Dotclear 2&lt;/a&gt;, voici un nouvel article qui liste quelques pistes
d'optimisations pour la base de données de Dotclear2 beta 7.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remarque : Je tiens à mettre l'accent sur le &amp;quot;beta 7&amp;quot; car ces
optimisations ne seront pas forcément applicables à la beta 8 ...&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;1) Tracker les requêtes SQL les plus lentes&lt;/h3&gt;
&lt;p&gt;Dotclear2 étant développé très proprement (merci à l'équipe de développement
de Dotclear2), toutes les requêtes SQL passent par un composant qui se nomme
&amp;quot;dblayer&amp;quot;, qui est une couche d'abstraction à l'accès de la base de
données.&lt;/p&gt;
&lt;pre&gt;
inc/clearbricks/dblayer/
&lt;/pre&gt;
&lt;p&gt;Cette couche permet à Dotclear2 de communiquer proprement avec sa base de
données, celle-ci est composée d'une classe php &amp;quot;dblayer.php&amp;quot; et de plusieurs
autres classes spécifiques aux bases de données que Dotclear 2 supporte.&lt;/p&gt;
&lt;p&gt;Après une étude rapide du fichier dblayer.php, on se rend très vite compte
que les requêtes de consultation &amp;quot;select&amp;quot; passent par la méthode &amp;quot;select()&amp;quot; de
la classe dbLayer présent dans le fichier.&lt;/p&gt;
&lt;p&gt;Pour connaitre la liste des requêtes SQL les plus longue, il suffit donc de
tracer les requêtes depuis cette méthode &lt;img src=&quot;/themes/geeek.org/smilies/wink.png&quot; alt=&quot;;-)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Voici la méthode &amp;quot;select()&amp;quot; avant patch:&lt;/strong&gt;&lt;/p&gt;
&lt;code class=&quot;php&quot;&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; select&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_query&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;__link,&lt;span style=&quot;color: #0000ff;&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;__last_result =&amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'con'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; =&amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'cols'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_num_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'rows'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_num_rows&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'cols'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'name'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_field_name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'type'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_field_type&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; record&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Et la voici après patch :&lt;/p&gt;
&lt;code class=&quot;php&quot;&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; select&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$starttime&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/microtime&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;microtime&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_query&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;__link,&lt;span style=&quot;color: #0000ff;&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$endtime&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/microtime&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;microtime&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tracesql&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$totaltime&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$endtime&lt;/span&gt; - &lt;span style=&quot;color: #0000ff;&quot;&gt;$starttime&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Si la requête est plus longue que 0.5 secondes&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$totaltime&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tracesql&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On trace la requête SQL&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$tracesql&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$fp&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/fopen&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fopen&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/tmp/db.log&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;a&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$data&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$totaltime&lt;/span&gt; . &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;;&amp;quot;&lt;/span&gt; . &lt;span style=&quot;color: #0000ff;&quot;&gt;$sql&lt;/span&gt; . &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Write the data to the file&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/fwrite&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fwrite&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fp&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Close the file&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.php.net/fclose&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fclose&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;__last_result =&amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'con'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; =&amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'cols'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_num_fields&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'rows'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_num_rows&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'cols'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'name'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_field_name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'type'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;db_field_type&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; record&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$result&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Cette modification devrait nous permettre de tracer les requêtes select qui
répondent en plus de 0.5 secondes dans un fichier qui se nomme &amp;quot;db.log&amp;quot; et qui
sera créé dans le répertoire temporaire &amp;quot;/tmp&amp;quot;.&lt;/p&gt;
&lt;h3&gt;2) Analyse de requêtes SQL&lt;/h3&gt;
&lt;p&gt;Après un peu de trafic le blog, vous devriez obtenir des requêtes SQL dans
le fichier &amp;quot;/tmp/db.log&amp;quot;. Si ce n'est pas le cas, soit votre blog ne contient
pas beaucoup d'articles, soit vous avez un serveur avec pas mal de CPU &lt;img src=&quot;/themes/geeek.org/smilies/wink.png&quot; alt=&quot;;-)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Note: Le premier chiffre qui se trouve devant la requête est le temps
d'exécution de celle-ci.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Voici les trois requêtes SQL les plus redondantes qui ont été
tracées sur mon blog. Les requêtes tracées dépendent énormément de la
configuration de votre blog, de la quantité d'articles que contient votre blog,
et de la qualité de votre hébergement Web :&lt;/strong&gt;&lt;/p&gt;
&lt;code class=&quot;sql&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; meta_id, meta_type, COUNT&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;M.post_id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; count &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; dc_meta M &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LEFT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; dc_post P &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; M.post_id = P.post_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; P.blog_id = &lt;span style=&quot;color: #ff0000;&quot;&gt;'default'&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; meta_type = &lt;span style=&quot;color: #ff0000;&quot;&gt;'tag'&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;post_status = &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; post_password &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;GROUP&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; meta_id,meta_type,P.blog_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; count &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;50&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; P.post_id, P.blog_id, P.user_id, P.cat_id, post_dt, post_tz, post_creadt, post_upddt, post_format, post_password, post_url, post_lang, post_title, post_excerpt, post_excerpt_xhtml, post_content, post_content_xhtml, post_notes, post_type, post_meta, post_status, post_selected, post_open_comment, post_open_tb, nb_comment, nb_trackback, U.user_name, U.user_firstname, U.user_displayname, U.user_email, U.user_url, C.cat_title, C.cat_url &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; dc_post P &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; dc_user U &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; U.user_id = P.user_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LEFT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;OUTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; dc_category C &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; P.cat_id = C.cat_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; P.blog_id = &lt;span style=&quot;color: #ff0000;&quot;&gt;'default'&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;post_status = &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; post_password &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; post_type = &lt;span style=&quot;color: #ff0000;&quot;&gt;'post'&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;post_dt = &lt;span style=&quot;color: #ff0000;&quot;&gt;'2006-03-29 22:49:37'&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; P.post_id &amp;lt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;315&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;OR&lt;/span&gt; post_dt &amp;lt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'2006-03-29 22:49:37'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; post_dt &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt;, P.post_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; C.comment_id, comment_dt, comment_tz, comment_upddt, comment_author, comment_email, comment_site, comment_content,&amp;nbsp; comment_trackback, comment_status, comment_spam_status, comment_spam_filter, comment_ip, P.post_title, P.post_url, P.post_id, P.post_password, P.post_dt, P.user_id, U.user_email, U.user_url &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; dc_comment C &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; dc_post P &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; C.post_id = P.post_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; dc_user U &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; P.user_id = U.user_id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; P.blog_id = &lt;span style=&quot;color: #ff0000;&quot;&gt;'default'&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;comment_status = &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; P.post_status = &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; post_password &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; comment_dt &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;10&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;La première chose à vérifier est que les éléments présents après le &amp;quot;WHERE&amp;quot;
des requêtes possèdent bien un index en base :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sur la première requête, il manque des index sur
&lt;strong&gt;meta_type&lt;/strong&gt;, &lt;strong&gt;post_status&lt;/strong&gt; et
&lt;strong&gt;post_password&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Sur la deuxième requête, il manque un index sur
&lt;strong&gt;post_type&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Sur la dernière requête, il manque un index sur
&lt;strong&gt;comment_status&lt;/strong&gt; et &lt;strong&gt;comment_dt&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Voici les requêtes SQL pour créer ces index en base :&lt;/strong&gt;&lt;/p&gt;
&lt;code class=&quot;sql&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`dc_post`&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`post_status`&lt;/span&gt; , &lt;span style=&quot;color: #ff0000;&quot;&gt;`post_password`&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; ;&lt;br /&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`dc_post`&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`post_type`&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; ;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`dc_meta`&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`meta_type`&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; ;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`dc_comment`&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`comment_status`&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; ;&lt;br /&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`dc_comment`&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;`comment_dt`&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; ;&lt;/code&gt;
&lt;p&gt;Après ces modifications, les requêtes que vous trouverez dans votre fichier
db.log devraient être moins nombreuses. &lt;a href=&quot;http://www.dotclear.net/forum/viewtopic.php?id=30748&quot; hreflang=&quot;fr&quot;&gt;J'ai
ouvert un post sur le forum de Dotclear2, mais je n'ai pas encore de réponse
quand à mes optimisations.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Je souhaite remercier l'équipe Dotclear2 pour leur travail et les
féliciter de cet merveilleux outil qu'est Dotclear2 !&lt;/strong&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.geeek.org/post/2007/11/18/Optimisation-de-Dotclear-2-Beta-7-%3A-La-face-cachee-de-la-base-de-donnees#comment-form</comments>
      <wfw:comment>http://www.geeek.org/post/2007/11/18/Optimisation-de-Dotclear-2-Beta-7-%3A-La-face-cachee-de-la-base-de-donnees#comment-form</wfw:comment>
      <wfw:commentRss>http://www.geeek.org/feed/rss2/comments/1080</wfw:commentRss>
      </item>
    
  <item>
    <title>Le Web 2.0 et MySQL</title>
    <link>http://www.geeek.org/post/2007/09/04/Le-Web-20-et-MySQL</link>
    <guid isPermaLink="false">urn:md5:8acf4f8afbd829af3f5c41e1c8db3903</guid>
    <pubDate>Tue, 04 Sep 2007 20:50:00 +0200</pubDate>
    <dc:creator>Ludovic Toinel</dc:creator>
        <category>Developpement</category>
        <category>mysql</category><category>performance</category><category>web2.0</category><category>webminaire</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.geeek.org/public/developpement/mysql.gif&quot; alt=&quot;mysql,webminaire&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Un webminaire est organisé par MySQL le &lt;strong&gt;12 septembre prochain à 10h00.&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;Le thème de ce Webminaire est :&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;Comment améliorer la performance, la montée en charge et la disponibilité d’une architecture Web 2.0 avec MySQL et MySQL Cluster.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Un sujet qui devrait intéresser beaucoup de lecteurs de ce blog je pense.
L'inscription à ce webminaire se fait sur le site de MySQL via cette URL :&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.mysql.com/news-and-events/web-seminars/display-47.html&quot; hreflang=&quot;fr&quot;&gt;http://www.mysql.com/news-and-events/web-seminars/display-47.html&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Pour assister à ce Webminaire, vous avez juste besoin d'un PC et d'une connexion Internet.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.geeek.org/post/2007/09/04/Le-Web-20-et-MySQL#comment-form</comments>
      <wfw:comment>http://www.geeek.org/post/2007/09/04/Le-Web-20-et-MySQL#comment-form</wfw:comment>
      <wfw:commentRss>http://www.geeek.org/feed/rss2/comments/980</wfw:commentRss>
      </item>
    
  <item>
    <title>Temps de chargement de votre Blog ..</title>
    <link>http://www.geeek.org/post/2007/04/16/Temps-de-chargement-de-votre-Blog</link>
    <guid isPermaLink="false">urn:md5:f7f4bbe6c104bf0c6aa1bbd2cee9ee27</guid>
    <pubDate>Mon, 16 Apr 2007 22:13:00 +0100</pubDate>
    <dc:creator>Ludovic Toinel</dc:creator>
        <category>Blogosphere</category>
        <category>blog</category><category>chargement</category><category>performance</category><category>temps</category>    
    <description>    &lt;p&gt;&lt;a href=&quot;http://webwait.com/&quot; hreflang=&quot;fr&quot;&gt;&lt;img src=&quot;http://www.geeek.org/public/blogosphere/webwait.jpg&quot; alt=&quot;webwait.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;En réponse au &lt;a href=&quot;http://blog.nicolargo.com/&quot; hreflang=&quot;fr&quot;&gt;ticket de Nicolargo&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://webwait.com/&quot; hreflang=&quot;fr&quot;&gt;&lt;img src=&quot;http://www.geeek.org/public/blogosphere/webwait.png&quot; alt=&quot;webwait.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Bon c'est bon ... d'accord, j'avoue j'ai triché .. Mon blog est hébergé chez moi ...
De chez vous cela donne quoi le temps de chargement de mon blog ?&lt;/p&gt;</description>
    
    
    
          <comments>http://www.geeek.org/post/2007/04/16/Temps-de-chargement-de-votre-Blog#comment-form</comments>
      <wfw:comment>http://www.geeek.org/post/2007/04/16/Temps-de-chargement-de-votre-Blog#comment-form</wfw:comment>
      <wfw:commentRss>http://www.geeek.org/feed/rss2/comments/800</wfw:commentRss>
      </item>
    
</channel>
</rss>