Details
-
Task
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
I created a table based on a hash of a date:
CREATE TABLE employees ( |
id INT NOT NULL, |
fname VARCHAR(30), |
lname VARCHAR(30), |
hired DATE NOT NULL DEFAULT NOW(), |
separated DATE NOT NULL DEFAULT '9999-12-31', |
job_code INT, |
store_id INT |
)
|
PARTITION BY HASH( DAYOFYEAR(hired) ) |
PARTITIONS 45;
|
I would think that the query engine could prune searches since the hash value is, in my situation, monotonically increasing, but it does not appear to be the case. In a range search, the optimizer should be able to put the lower and upper bounds of the range into the hash function to come up with the upper and lower bounds for pruning partitions.