Details
Description
(Filing based on investigation of a support case)
When a statement uses a partitioned table, there is O(#partitions_in_table) overhead even if the statement actually touches O(1) partitions.
We always had this overhead (there is MDEV-20250 to get rid of it), but in 10.6 it got larger.
In order to observe the overhead increase one needs:
- A table with a lot (thousands) or partitions.
- A statement that touches one or a few rows in one/few partitions. The statement must be sufficiently lightweight so the extra overhead is visible.
- The above statement must be invoked many times by the embedding statement. This way, the overhead adds up and can be observed.
The total slowdown observed was around 40%.
Causes
- One known reason is handler_stats_disable() and related calls which were added
byMDEV-31558. It has unnecessary loops that go through all partitions.
Overhead that already existed in 10.5:
- Calls to extra(HA_EXTRA_.._CHILDREN). These are no-ops if one is not using MERGE engine.
- Calls to extra(HA_EXTRA_*_KEYREAD). These only make sense for the partitions that are touched by the query
Attachments
Issue Links
- causes
-
MDEV-33622 Server crashes when the UPDATE statement (which has duplicate key) is run after setting a low thread_stack
- Closed
-
MDEV-33623 Partitioning is broken on big endian architectures
- Closed
- relates to
-
MDEV-34636 SIGSEGV in ha_spider::update_create_info & SIGSEGV in my_hash_insert on ALTER
- Closed