Skip navigation links

MySQL Forums :: Partitioning :: Partitioning by hour


Advanced Search

Partitioning by hour
Posted by: Alejandro Boldt ()
Date: September 11, 2009 01:32PM

Hi,

I created partitions by hour like this:

PARTITION BY LIST (hour(logtime))
(
PARTITION p00 VALUES IN (0),
PARTITION p01 VALUES IN (1),
PARTITION p02 VALUES IN (2),
PARTITION p03 VALUES IN (3),
PARTITION p04 VALUES IN (4),
PARTITION p05 VALUES IN (5),
PARTITION p06 VALUES IN (6),
PARTITION p07 VALUES IN (7),
PARTITION p08 VALUES IN (8),
PARTITION p09 VALUES IN (9),
PARTITION p10 VALUES IN (10),
PARTITION p11 VALUES IN (11),
PARTITION p12 VALUES IN (12),
PARTITION p13 VALUES IN (13),
PARTITION p14 VALUES IN (14),
PARTITION p15 VALUES IN (15),
PARTITION p16 VALUES IN (16),
PARTITION p17 VALUES IN (17),
PARTITION p18 VALUES IN (18),
PARTITION p19 VALUES IN (19),
PARTITION p20 VALUES IN (20),
PARTITION p21 VALUES IN (21),
PARTITION p22 VALUES IN (22),
PARTITION p23 VALUES IN (23)
);

But when doing a query similar to select * from <table> where logtime between "12:00:00" and "12:59:59", mysql shows it will do a full table scan, that is, it will read all the partitions instead of the one for the 12th hour.

Is this expected behavior?

Thanks,

Alejandro

Options: ReplyQuote


Subject Views Written By Posted
Partitioning by hour 2537 Alejandro Boldt 09/11/2009 01:32PM
Re: Partitioning by hour 1932 Rick James 09/12/2009 03:12PM
Re: Partitioning by hour 1853 Rick James 09/12/2009 09:31PM
Re: Partitioning by hour 2258 Alejandro Boldt 09/17/2009 06:31AM
Re: Partitioning by hour 1874 Rick James 09/17/2009 08:45AM
Re: Partitioning by hour 1887 Alejandro Boldt 09/17/2009 09:50AM
Re: Partitioning by hour 1902 Mattias Jonsson 09/21/2009 03:55AM


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.