MySQL Forums
Forum List  »  Partitioning

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
3005
September 11, 2009 01:32PM
2224
September 12, 2009 03:12PM
2082
September 12, 2009 09:31PM
2722
September 17, 2009 06:31AM
2132
September 17, 2009 08:45AM
2170
September 17, 2009 09:50AM
2149
September 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.