<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="http://bugs.horde.org/themes/feed-rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <title>Performance query MYSQL</title>
  <pubDate>Sun, 07 Sep 2008 04:39:33 -0400</pubDate>
  <link>http://bugs.horde.org/ticket/6633</link>
  <atom:link rel="self" type="application/rss+xml" title="Performance query MYSQL" href="http://bugs.horde.org/ticket/6633/rss" />
  <description>Performance query MYSQL</description>

  
  
  <item>
   <title>Hi we have some problem with a query:

SELECT c.datatree_i</title>
   <description>Hi we have some problem with a query:

SELECT c.datatree_id, c.datatree_name FROM horde_datatree c LEFT JOIN horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id WHERE c.group_uid = 'horde.shares.kronolith' AND ( a1.attribute_name = 'owner' AND a1.attribute_value = 'marco.curradi' ) GROUP BY c.datatree_id, c.datatree_name, c.datatree_order ORDER BY c.datatree_order, c.datatree_name, c.datatree_id;

This query use the CPU at the 100%. 

We have this problem only the users connection are about 20-30 or more.  
This query use the disk  and if running 3-4 this query the process of Mysql use the 100% of CPU.
This query find 1 record but move 15000 record on temp (see the attachment).
I think the problem is the ORDER BY. Is necessary to use ORDER BY ? 

thanks for your help
</description>
   <pubDate>Tue, 22 Apr 2008 04:58:39 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6633#t44789</link>
  </item>
  <item>
   <title>I created an index on the table horde_datatree_attributes on</title>
   <description>I created an index on the table horde_datatree_attributes on attribute_value.
My problem seems resolved (I hope). 
</description>
   <pubDate>Tue, 22 Apr 2008 06:54:59 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6633#t44792</link>
  </item>
  <item>
   <title>&gt; I created an index on the table horde_datatree_attributes </title>
   <description>&gt; I created an index on the table horde_datatree_attributes on attribute_value.
&gt; My problem seems resolved (I hope).

This index has been in CVS code since 9/30/07...along with other added indexes. You should check the scripts/upgrades directory for any others you may have missed.

On a related note, if your feeling adventuresome, there is a new share driver that does away with the datatree completely. It's currently considered 'beta' status, but is available for testing in the latest Horde CVS HEAD. In the administration settings, choose 'SQL' as the driver for shares and be sure to run the upgrade scripts located in the various [appname]/scripts/upgrades directory.</description>
   <pubDate>Tue, 22 Apr 2008 07:55:02 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6633#t44794</link>
  </item>
  

 </channel>
</rss>
