Re: I searched table on one partiton, but MySQL scanning two partitons
Posted by:
Rick James
Date: March 04, 2012 02:28PM
Yes. Note that the extra one is always the first partition. Note what happens with invalid DATETIME strings:
mysql> SELECT TO_DAYS('2011-02-29'), TO_DAYS('2012-02-29');
+-----------------------+-----------------------+
| TO_DAYS('2011-02-29') | TO_DAYS('2012-02-29') |
+-----------------------+-----------------------+
| NULL | 734927 |
+-----------------------+-----------------------+
1 row in set, 1 warning (0.00 sec)
NULLs (and zeros) go into the first parition (because of the LESS THAN clause).
The standard recommendation is to have nothing deliberately in the first partition. That is, start the partitions you really want with the second partition. That way, the cost of the seemingly spurious reach into the empty pmin will be minimal.
Subject
Views
Written By
Posted
3818
March 03, 2012 04:01AM
Re: I searched table on one partiton, but MySQL scanning two partitons
1889
March 04, 2012 02:28PM
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.