mariadb/storage
Monty b5d65fc105 Optimize performance of my_bitmap
MDEV-33502 Slowdown when running nested statement with many partitions

This change was triggered to help some MariaDB users with close to
10000 bits in their bitmaps.

- Change underlaying storage to be 64 bit instead of 32bit.
  - This reduses number of loops to scan bitmaps.
  - This can cause some bitmaps to be 4 byte large.
- Ensure that all not used top-bits are always 0 (simplifes code as
  the last 64 bit storage is not a special case anymore).
- Use my_find_first_bit() to find the first set bit which is much faster
  than scanning trough things byte by byte and then bit by bit.

Other things:
- Added a bool to remember if my_bitmap_init() did allocate the bitmap
  array. my_bitmap_free() will only free arrays it did allocate.
  This allowed me to remove setting 'bitmap=0' before calling
  my_bitmap_free() for cases where the bitmap's where allocated externally.
- my_bitmap_init() sets bitmap to 0 in case of failure.
- Added 'universal' asserts to most bitmap functions.
- Change all remaining calls to bitmap_init() to my_bitmap_init().
  - To finish the change from 2014.
- Changed all usage of uint32 in my_bitmap.h to my_bitmap_map.
- Updated bitmap_copy() to handle bitmaps of different size.
- Removed const from bitmap_exists_intersection() as this caused casts
  on all usage.
- Removed not used function bitmap_set_above().
- Renamed create_last_word_mask() to create_last_bit_mask() (to match
  name changes in my_bitmap.cc)
- Extended bitmap-t with test for more bitmap functions.
2024-02-27 14:51:33 +02:00
..
archive Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
blackhole Merge 10.4 into 10.5 2023-02-10 12:02:11 +02:00
columnstore fix columnstore compilation on fc39 2024-01-31 22:02:59 +01:00
connect Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
csv Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
example Merge branch '10.4' into 10.5 2023-12-02 01:02:50 +01:00
federated Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
federatedx Merge branch '10.5' into 10.6 2024-01-31 18:04:03 +01:00
heap Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
innobase MDEV-24671 fixup: Remove srv_max_n_threads 2024-02-27 11:14:28 +02:00
maria Merge 10.5 into 10.6 2024-02-08 10:38:53 +02:00
mroonga Optimize performance of my_bitmap 2024-02-27 14:51:33 +02:00
myisam Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
myisammrg Fixed some mtr tests that failed on windows 2024-01-23 13:03:12 +02:00
oqgraph Merge 10.5 into 10.6 2023-09-11 14:46:39 +03:00
perfschema Merge 10.5 into 10.6 2024-02-08 10:38:53 +02:00
rocksdb Optimize performance of my_bitmap 2024-02-27 14:51:33 +02:00
sequence Merge 10.4 into 10.5 2023-02-10 12:02:11 +02:00
sphinx Merge branch '10.5' into 10.6 2024-01-11 12:59:22 +11:00
spider Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
test_sql_discovery Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00