mariadb/mysql-test/suite/heap
Monty 52c29f3bdc MDEV-35469 Heap tables are calling mallocs to often
Heap tables are allocated blocks to store rows according to
my_default_record_cache (mapped to the server global variable
 read_buffer_size).
This causes performance issues when the record length is big
(> 1000 bytes) and the my_default_record_cache is small.

Changed to instead split the default heap allocation to 1/16 of the
allowed space and not use my_default_record_cache anymore when creating
the heap. The allocation is also aligned to be just under a power of 2.

For some test that I have been running, which was using record length=633,
the speed of the query doubled thanks to this change.

Other things:
- Fixed calculation of max_records passed to hp_create() to take
  into account padding between records.
- Updated calculation of memory needed by heap tables. Before we
  did not take into account internal structures needed to access rows.
- Changed block sized for memory_table from 1 to 16384 to get less
  fragmentation. This also avoids a problem where we need 1K
  to manage index and row storage which was not counted for before.
- Moved heap memory usage to a separate test for 32 bit.
- Allocate all data blocks in heap in powers of 2. Change reported
  memory usage for heap to reflect this.

Reviewed-by: Sergei Golubchik <serg@mariadb.org>
2025-01-05 16:40:11 +02:00
..
btree_varchar_null.result MDEV-4813 Replication fails on updating a MEMORY table with an index using btree 2014-10-07 10:54:14 +02:00
btree_varchar_null.test MDEV-4813 Replication fails on updating a MEMORY table with an index using btree 2014-10-07 10:54:14 +02:00
drop.result test dropping of a MEMORY table 2020-07-04 01:44:46 +02:00
drop.test test dropping of a MEMORY table 2020-07-04 01:44:46 +02:00
heap.result MDEV-35469 Heap tables are calling mallocs to often 2025-01-05 16:40:11 +02:00
heap.test MDEV-35469 Heap tables are calling mallocs to often 2025-01-05 16:40:11 +02:00
heap_auto_increment.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
heap_auto_increment.test Merge branch '10.1' into 10.2 2018-06-21 23:47:39 +02:00
heap_btree.result MDEV-7317: Make an index ignorable to the optimizer 2021-03-04 22:50:00 +05:30
heap_btree.test Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
heap_hash.result MDEV-7317: Make an index ignorable to the optimizer 2021-03-04 22:50:00 +05:30
heap_hash.test MDEV-16188 Post merge fixes: more for TokuDB 2019-02-08 12:32:31 -08:00
heap_memory_used,32bit.rdiff MDEV-35469 Heap tables are calling mallocs to often 2025-01-05 16:40:11 +02:00
heap_memory_used.result MDEV-35469 Heap tables are calling mallocs to often 2025-01-05 16:40:11 +02:00
heap_memory_used.test MDEV-35469 Heap tables are calling mallocs to often 2025-01-05 16:40:11 +02:00