Re: Partitioning with range(to_days) issue
Hi Jools,
Have you benchmarked the performance of your queries on the partitioned tables vs. non-partitioned tables? I have found great performance benefits of partitioning by range using to_days. I think your issue is that EXPLAIN is not correctly estimating the rows that would need to be read. This is likely because the optimizer doesn't have the statistics. If a full table scan (type: ALL) is chosen, then EXPLAIN reports the number of rows it *thinks* are in the table at the time. But if partition pruning is used, the optimizer doesn't report the number of rows it thinks is in each partition, it just simply reports the total number of rows in the table. This could be considered a bug, but currently it is a documented issue. If you were to run the query, the whole table would *not* be scanned.. only the necessary partitions would be scanned.
Also, be careful using "SELECT count(*)" for your tests if you're not doing SELECT count(*) in your real application. COUNT queries will often cause the optimizer to choose an index scan (since you only need a COUNT) as opposed to whatever would be needed in your "real" query.
Sarah Sproehnle
MySQL AB
www.mysql.com
Subject
Views
Written By
Posted
11011
October 29, 2009 11:13AM
3615
October 31, 2009 12:00PM
3266
November 02, 2009 04:07AM
3117
November 02, 2009 10:22AM
3127
November 03, 2009 02:18AM
3810
November 03, 2009 09:32AM
2848
January 13, 2010 05:17AM
2724
January 22, 2010 11:09PM
3234
November 05, 2009 03:12AM
3139
November 05, 2009 08:37AM
4035
November 05, 2009 09:51AM
2959
November 17, 2009 05:51AM
Re: Partitioning with range(to_days) issue
3101
November 05, 2009 07:47PM
2811
January 13, 2010 06:36AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.