1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-09 08:01:34 +03:00
Files
mariadb/mysql-test/r
Mattias Jonsson 42282c10ce Bug#13694811: THE OPTIMIZER WRONGLY USES THE FIRST INNODB
PARTITION STATISTICS

Problem was the fix for bug#11756867; It always used the first
partitions, and stopped after it checked 10 [sub]partitions.
(or until it found a partition which would contain a match).

This results in bad statistics for tables where the first 10 partitions
don't represent the majority of the data (like when the first 10
partitions only contained a few rows in total).

The solution was to take statisics from the partitions containing
the most rows instead:

Added an array of partition ids which is sorted by number of records
in descending order.

this array is used in records_in_range to cover as many records as
possible in as few calls as possible.

Also changed the limit of how many partitions to use for the statistics
from a static max of 10 partitions, into a dynamic model:
Maximum number of partitions is now log2(total number of partitions)
taken from the ordered array.
It will continue calling partitions records_in_range until it has 
checked:
(total rows in matching partitions) * (maximum number of partitions)
/ (number of used partitions)

Also reverted the changes for ha_partition::scan_time() and
ha_partition::estimate_rows_upper_bound() to before
the fix of  bug#11756867. Since they are not as slow as
records_in_range.
2012-02-22 23:13:36 +01:00
..
2010-02-25 23:13:11 +04:00
2011-04-07 14:44:26 +03:00
2011-01-25 12:14:28 +05:30
2010-03-09 16:09:32 +01:00
2009-08-10 15:46:20 -03:00
2010-12-14 12:33:03 +03:00
2011-05-04 17:12:45 +02:00
2009-06-01 16:00:38 +04:00
2009-05-06 15:00:14 +05:30
2011-12-14 14:41:40 +01:00
2011-03-29 10:09:05 +02:00
2010-12-14 12:33:03 +03:00
2010-12-01 12:25:31 +05:30
2009-11-06 17:54:19 +03:00
2010-01-29 16:54:27 +02:00
2011-01-26 16:50:21 +01:00
2009-10-27 14:09:36 +04:00
2010-10-04 12:51:26 +04:00
2012-01-26 10:25:23 +01:00
2011-08-09 11:42:07 +04:00
2009-06-10 11:58:36 +03:00
2011-09-29 10:56:21 +01:00