<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: My Innodb Feature wishes</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:23:57 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Linux Unix &#187; Awesome List of InnoDB (MySQL) Feature Wishes</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-2143</link>
		<dc:creator>Linux Unix &#187; Awesome List of InnoDB (MySQL) Feature Wishes</dc:creator>
		<pubDate>Fri, 01 Sep 2006 11:54:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-2143</guid>
		<description>[...] Well, what do you expect from MySQL tuning guru Peter Zaitsev? He spoke at a number of the MySQL User&#8217;s Conference sessions. If you use MySQL, you should probably care about this wishlist. The &#8220;tablespaces&#8221; item does it for me.read more&#160;&#124;&#160;digg story [...]</description>
		<content:encoded><![CDATA[<p>[...] Well, what do you expect from MySQL tuning guru Peter Zaitsev? He spoke at a number of the MySQL User&#8217;s Conference sessions. If you use MySQL, you should probably care about this wishlist. The &#8220;tablespaces&#8221; item does it for me.read more&nbsp;|&nbsp;digg story [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-38</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 19 May 2006 23:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-38</guid>
		<description>Dmitry, 

This is pretty common request which is of high priority as soon as I know.  It is however not as trivial as it sounds as Innodb is multi versioning engine so each transaction could see different amount of rows  in the table which needs extra handling.  Not what it is impossible just not as trivial as you&#039;re saying.

At this poing if you have no holes in your primary key and it goes from one   select max(id)  is frequently good and fast way to get the count.  You also could use counter table especially now with Triggers in MySQL 5.0 

Yes I know it is ugly but we have to live with what we have :)</description>
		<content:encoded><![CDATA[<p>Dmitry, </p>
<p>This is pretty common request which is of high priority as soon as I know.  It is however not as trivial as it sounds as Innodb is multi versioning engine so each transaction could see different amount of rows  in the table which needs extra handling.  Not what it is impossible just not as trivial as you&#8217;re saying.</p>
<p>At this poing if you have no holes in your primary key and it goes from one   select max(id)  is frequently good and fast way to get the count.  You also could use counter table especially now with Triggers in MySQL 5.0 </p>
<p>Yes I know it is ugly but we have to live with what we have <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-37</link>
		<dc:creator>Dmitry</dc:creator>
		<pubDate>Fri, 19 May 2006 20:45:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-37</guid>
		<description>simple &quot;SELECT COUNT(*) FROM table&quot; takes minutes/hours to run on tables with xxM records, can&#039;t InnoDB calculate it based on Primary Key instantly?</description>
		<content:encoded><![CDATA[<p>simple &#8220;SELECT COUNT(*) FROM table&#8221; takes minutes/hours to run on tables with xxM records, can&#8217;t InnoDB calculate it based on Primary Key instantly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-33</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 16 May 2006 00:00:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-33</guid>
		<description>Gokhan, 

This bug is actually a bit different even though it also correspond to poor 
subselect optimization and they have a lot in common.

In general it might be better to report similar looking bug as new bug as if it is the same bug it will be quickly checked as soon as bug fixed, if it is not both of them can be fixed and so you will not find out the bug fixed  does not apply to your case. 

Speaking about long time to fix the bug.  Yes there is large backlog formed due to the rush with 5.0 development cycle.  I hope back backlog will be reduced soon and we&#039;ll get back to prompt bug resolution.</description>
		<content:encoded><![CDATA[<p>Gokhan, </p>
<p>This bug is actually a bit different even though it also correspond to poor<br />
subselect optimization and they have a lot in common.</p>
<p>In general it might be better to report similar looking bug as new bug as if it is the same bug it will be quickly checked as soon as bug fixed, if it is not both of them can be fixed and so you will not find out the bug fixed  does not apply to your case. </p>
<p>Speaking about long time to fix the bug.  Yes there is large backlog formed due to the rush with 5.0 development cycle.  I hope back backlog will be reduced soon and we&#8217;ll get back to prompt bug resolution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gokhan Demir</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-31</link>
		<dc:creator>Gokhan Demir</dc:creator>
		<pubDate>Mon, 15 May 2006 18:16:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-31</guid>
		<description>Hi Peter,

Thanks for the suggestion. Before submitting this case as a bug, I made a search through the bug system and found that bug, most probably very similar to this.

http://bugs.mysql.com/bug.php?id=18465

Therefore, I decided not to submit this case as a bug.

By the way, especially nowadays, it is getting too much time for mysql developers to fix the bugs. There are even some severity 1 bugs open for six months or so, and no response from MySQL at all.

Best Regards,
Gokhan</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>Thanks for the suggestion. Before submitting this case as a bug, I made a search through the bug system and found that bug, most probably very similar to this.</p>
<p><a href="http://bugs.mysql.com/bug.php?id=18465" rel="nofollow">http://bugs.mysql.com/bug.php?id=18465</a></p>
<p>Therefore, I decided not to submit this case as a bug.</p>
<p>By the way, especially nowadays, it is getting too much time for mysql developers to fix the bugs. There are even some severity 1 bugs open for six months or so, and no response from MySQL at all.</p>
<p>Best Regards,<br />
Gokhan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-30</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Mon, 15 May 2006 03:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-30</guid>
		<description>Gokhan,

In this case it could be Optimizer bug with subselect execution or with explain.  Please report it at http://bugs.mysql.com  This query should be using all 3 keyparts but explain shows it does not. 

Note there are VERY many missing optimizations with Subselects at this point.  You should be very careful migrating Subselects from other Database servers as they could run much slower. 

In your case the best approach perhaps is to think how you can rewrite this query to perform well on MySQL.</description>
		<content:encoded><![CDATA[<p>Gokhan,</p>
<p>In this case it could be Optimizer bug with subselect execution or with explain.  Please report it at <a href="http://bugs.mysql.com" rel="nofollow">http://bugs.mysql.com</a>  This query should be using all 3 keyparts but explain shows it does not. </p>
<p>Note there are VERY many missing optimizations with Subselects at this point.  You should be very careful migrating Subselects from other Database servers as they could run much slower. </p>
<p>In your case the best approach perhaps is to think how you can rewrite this query to perform well on MySQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gokhan Demir</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-29</link>
		<dc:creator>Gokhan Demir</dc:creator>
		<pubDate>Sun, 14 May 2006 10:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-29</guid>
		<description>Why can Sybase use the three columns and MySQL cannot?</description>
		<content:encoded><![CDATA[<p>Why can Sybase use the three columns and MySQL cannot?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gokhan Demir</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-28</link>
		<dc:creator>Gokhan Demir</dc:creator>
		<pubDate>Sun, 14 May 2006 10:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-28</guid>
		<description>This same test case takes 30 seconds to complete with Sybase ASE 15. Showplan output clearly states the usage of all three columns in the correlated subquery. Now, I have a production system with this kind of select and the data is growing day by day, I don&#039;t know what to do.</description>
		<content:encoded><![CDATA[<p>This same test case takes 30 seconds to complete with Sybase ASE 15. Showplan output clearly states the usage of all three columns in the correlated subquery. Now, I have a production system with this kind of select and the data is growing day by day, I don&#8217;t know what to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-27</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sun, 14 May 2006 02:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-27</guid>
		<description>Gokhan,

I finally had a time to take a look at your case.  I&#039;m not sure what it has to do with Range usage.   In your case join can be only performed using two key parts. You can see it in explain as ref: &quot;test.T.cur,const&quot; with &quot;ref&quot; access type.   At the stage when Join happens the value for third keypart is not yet avaiable as subselect is not executed.

Now if you look at the number of rows query would return without subselect:

mysql&gt; select count(*) from Statement T join CurrDailyVal Q on Q.cur1 = T.cur  and Q.cur2 = &quot;EUR&quot;;
+----------+
&#124; count(*) &#124;
+----------+
&#124; 55125114 &#124;
+----------+
1 row in set (1 min 17.06 sec)

This subquery will need to be executed 55mi times so do not expect fast answer even if subquery is almost instant :)</description>
		<content:encoded><![CDATA[<p>Gokhan,</p>
<p>I finally had a time to take a look at your case.  I&#8217;m not sure what it has to do with Range usage.   In your case join can be only performed using two key parts. You can see it in explain as ref: &#8220;test.T.cur,const&#8221; with &#8220;ref&#8221; access type.   At the stage when Join happens the value for third keypart is not yet avaiable as subselect is not executed.</p>
<p>Now if you look at the number of rows query would return without subselect:</p>
<p>mysql> select count(*) from Statement T join CurrDailyVal Q on Q.cur1 = T.cur  and Q.cur2 = &#8220;EUR&#8221;;<br />
+&#8212;&#8212;&#8212;-+<br />
| count(*) |<br />
+&#8212;&#8212;&#8212;-+<br />
| 55125114 |<br />
+&#8212;&#8212;&#8212;-+<br />
1 row in set (1 min 17.06 sec)</p>
<p>This subquery will need to be executed 55mi times so do not expect fast answer even if subquery is almost instant <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gokhan Demir</title>
		<link>http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/comment-page-1/#comment-24</link>
		<dc:creator>Gokhan Demir</dc:creator>
		<pubDate>Wed, 10 May 2006 19:24:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2006/05/04/my-innodb-feature-wishes/#comment-24</guid>
		<description>According to the documentation at MySQL site, Peter is right. MySQL should use all three columns in the inner select. However, I have faced performance problems in the real world which made me think MySQL does not use the range indexes efficiently. 

For the example query I previously attached here, I have prepared a test case, where you can see what I mean. To better illustrate what I mean, I have put rather big amounts of data to both tables. Statement table has 172806 rows, and CurrDailyVal has 638 rows. You can download the test case at http://igonline.biz/gdemir/data.tar.bz2 and try for yourself. The test case file itself is 1367455 bytes (~1.3 MB).</description>
		<content:encoded><![CDATA[<p>According to the documentation at MySQL site, Peter is right. MySQL should use all three columns in the inner select. However, I have faced performance problems in the real world which made me think MySQL does not use the range indexes efficiently. </p>
<p>For the example query I previously attached here, I have prepared a test case, where you can see what I mean. To better illustrate what I mean, I have put rather big amounts of data to both tables. Statement table has 172806 rows, and CurrDailyVal has 638 rows. You can download the test case at <a href="http://igonline.biz/gdemir/data.tar.bz2" rel="nofollow">http://igonline.biz/gdemir/data.tar.bz2</a> and try for yourself. The test case file itself is 1367455 bytes (~1.3 MB).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
