MySQL Forums
Forum List  »  Partitioning

Partition on day of year
Posted by: Brian Wilson
Date: February 28, 2011 07:18PM

Hi,

I am having trouble understanding this scenario:

| test_jobs2 | CREATE TABLE `test_jobs2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`printer_name` varchar(100) NOT NULL,
`job_date_time` datetime NOT NULL,
`username` varchar(100) NOT NULL,
`pages_printed` int(4) NOT NULL,
PRIMARY KEY (`id`,`job_date_time`),
KEY `search` (`customer_id`,`job_date_time`,`printer_name`,`username`)
) ENGINE=MyISAM AUTO_INCREMENT=100001 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH ( TO_DAYS(`job_date_time`))
PARTITIONS 366 */ |

But when I run this explain partitions query:

mysql> explain partitions select * from test_jobs2 where job_date_time > '2011-01-01' and job_date_time < '2011-01-01 23:59:59'\G

The output shows it hitting all the partitions instead of the expected single partition.

Can someone help?

Options: ReplyQuote


Subject
Views
Written By
Posted
Partition on day of year
8434
February 28, 2011 07:18PM
2857
February 28, 2011 08:43PM
4058
March 01, 2011 12:53AM
2532
March 01, 2011 10:33PM
2416
March 02, 2011 10:00AM
2023
March 02, 2011 11:16AM
2191
March 03, 2011 09:47PM
2629
March 04, 2011 08:58AM
2078
March 04, 2011 10:45AM
2615
March 04, 2011 08:23PM
1798
March 02, 2011 02:58AM


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.