Bug #48477 should convert some delete statements to truncate in partitioned tables
Submitted: 2 Nov 2009 16:28 Modified: 8 Sep 2010 12:18
Reporter: Eric Herman Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Partitions Severity:S4 (Feature request)
Version:5.1.40 OS:Any
Assigned to: CPU Architecture:Any

[2 Nov 2009 16:28] Eric Herman
Description:
Partitioned tables sometimes have the knowledge to make delete much faster.  For instance, a table partitioned by RANGE should be able to determine if a delete applies to the entire RANGE of the partition by inspection of the WHERE clause. In these cases perhaps it could perform a truncate rather than deletes. This would make partitions much faster in an otherwise complete transparent way to apps.

How to repeat:
Create a partitioned table.

Insert lots of rows across all partitions.

Issue a delete statement which deletes all the rows from a single partition.

Compare the time required to the time required to truncate a table.

Suggested fix:
(developers' implementation decisions)
[2 Nov 2009 17:10] Valeriy Kravchuk
Thank you for the feature request.
[8 Sep 2010 12:18] Mattias Jonsson
One cannot use truncate since that is not transactional.