MySQL Forums
Forum List  »  Partitioning

Re: Partition Pruning
Posted by: Mattias Jonsson
Date: September 29, 2010 04:49AM

To see how it works, you can look for MONOTONIC in the source.

from item.h:
typedef enum monotonicity_info
{
NON_MONOTONIC, /* none of the below holds */
MONOTONIC_INCREASING, /* F() is unary and (x < y) => (F(x) <= F(y)) */
MONOTONIC_INCREASING_NOT_NULL, /* But only for valid/real x and y */
MONOTONIC_STRICT_INCREASING,/* F() is unary and (x < y) => (F(x) < F(y)) */
MONOTONIC_STRICT_INCREASING_NOT_NULL /* But only for valid/real x and y */
} enum_monotonicity_info;

It has to search the first partition if the partitioning function is MONOTONIC_*_INCREASING_NOT_NULL (only TO_DAYS is). So if the partitioning function is '(int_col)' it will never look for a NULL for a range query.

If you use the COLUMNS partitioning in 5.5 you can use a DATE/DATETIME column directly and it will not need the TO_DAYS() function and will not have this problem.

Options: ReplyQuote


Subject
Views
Written By
Posted
3485
September 17, 2010 06:04AM
1389
September 17, 2010 06:43AM
1490
September 21, 2010 02:41PM
1418
September 21, 2010 04:33PM
1411
September 23, 2010 09:17AM
1496
September 28, 2010 10:51AM
1317
September 28, 2010 04:52PM
Re: Partition Pruning
1932
September 29, 2010 04:49AM


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.