Get partition name for specific date
Hi,
for an InnoDB table historical_offers with a field
`valid_at` date NOT NULL DEFAULT '0000-00-00'
and the partitioning
PARTITION BY KEY(valid_at) PARTITIONS 92
I want to get the partition name for a specific date, so that I can truncate that partition, e.g.
ALTER TABLE historical_offers TRUNCATE PARTITION date_to_partition_name('2012-09-28')
where date_to_partition_name is what I am looking for.
I tried calculating modulo 92 the number of days since 0000-01-01 and 1970-01-01, but I got wrong numbers.
Thanks, Jan
Subject
Views
Written By
Posted
Get partition name for specific date
3057
October 08, 2012 12:48PM
1719
October 09, 2012 09:21AM
1590
October 10, 2012 03:18AM
1708
October 11, 2012 07:12PM
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.