Bug #63879 Dropping a partitioned table is extremely costly
Submitted: 30 Dec 2011 10:01 Modified: 30 Dec 2011 10:12
Reporter: Domas Mituzas Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any

[30 Dec 2011 10:01] Domas Mituzas
Description:
Dropping of a partitioned table is seen by InnoDB as individual table drops per each partition - so inefficiencies that exist at dropping single table (LRU walk, see #51325) are multiplied by number of partitions.

Edge case would be dropping a table with 1000 partitions on a machine that has large buffer pool - e.g. if 60G buffer pool walk takes 0.5s, while holding LRU lock, partitioned drop would mean 10 minute lockup of LRU (on a busy server add thrashing by all the other threads too). 

It should be seen as separate issue from #51325 - it is a flaw in partitioning/innodb collaboration, not individual LRU walk problem.

How to repeat:
create table with many partitions on busy server that has buffer pool full of data
drop it, observe

Suggested fix:
walk the LRU once or don't walk at all