MySQL Forums
Forum List  »  Partitioning

Re: Get partition name for specific date
Posted by: Rick James
Date: October 09, 2012 09:21AM

It's a bit kludgy, but this seems feasible:
EXPLAIN PARTITIONS SELECT * FROM tbl WHERE valid_at = '2012-09-28';
Then parse that to get the partition name.

Have you checked your SELECTs to see if they are doing "pruning"?

You are assuming there is only one day's worth of data in that partition. Because of that risky assumption, I prefer partitioning BY RANGE and do a DROP and REORGANIZE every day to shift the partitions.

Also, I find 92 to be a large number of partitions; I would go with weekly, not daily, for a quarter's worth of data.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Get partition name for specific date
1676
October 09, 2012 09:21AM


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.