MySQL Forums :: Partitioning :: Partition on day of year


Advanced Search

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 6057 Brian Wilson 02/28/2011 07:18PM
Re: Partition on day of year 2067 Brian Wilson 02/28/2011 08:43PM
Re: Partition on day of year 3205 Shantanu Oak 03/01/2011 12:53AM
Re: Partition on day of year 1899 Rick James 03/01/2011 10:33PM
Re: Partition on day of year 1653 Brian Wilson 03/02/2011 10:00AM
Re: Partition on day of year 1448 Rick James 03/02/2011 11:16AM
Re: Partition on day of year 1529 Brian Wilson 03/03/2011 09:47PM
Re: Partition on day of year 2001 Rick James 03/04/2011 08:58AM
Re: Partition on day of year 1596 Brian Wilson 03/04/2011 10:45AM
Re: Partition on day of year 1975 Rick James 03/04/2011 08:23PM
Re: Partition on day of year 1313 Mattias Jonsson 03/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.