1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
mariadb/sql
Sergei Petrunia 224efb91b4 MDEV-38426: Clustered PK not used for Loose Index Scan optimization
Loose Index Scan optimization can only be used when the index it is
uses covers all columns used by the query. So, it would not be
attempted for indexes that are not present in table->covering_keys.

Before commit ed0a723566 (pushed to 11.0), Clustered PK would be
present in table->covering_keys if primary key columns are covering.

However, that commit gave Clustered PKs special treatment: they are
no longer present in table->covering_keys. This caused Loose Scan not
to be considered for Clustered PKs.

Fixed this by making the check in get_best_group_min_max() to allow
Loose Scan if all fields used by the query are parts of the Clustered PK.

Also made changes:
- The logic in JOIN_TAB::save_explain_data() assumed that Loose Scan
  could only be used for index-only scans. This is not the case for
  clustered PKs.
- One query in group_min_max_innodb started to use Loose Scan. It did so
  in 10.11, too.
2025-12-30 20:49:26 +02:00
..
2025-10-25 00:19:11 +07:00
…
2025-10-25 00:19:11 +07:00
…
2025-09-03 10:32:56 +03:00
2024-08-12 09:32:30 +01:00
…
2025-09-04 18:08:39 +03:00
2024-01-19 09:07:48 +02:00
…
2023-12-21 02:14:59 +01:00
…
…
2024-12-02 11:35:34 +02:00
2024-11-29 12:37:46 +02:00
2024-11-29 12:37:46 +02:00
2025-09-04 18:08:39 +03:00
2024-10-30 15:11:17 +01:00
…
2025-01-30 12:01:11 +01:00
2025-09-03 10:32:56 +03:00
2024-12-02 11:35:34 +02:00
2023-12-21 02:14:59 +01:00
2024-05-30 16:04:00 +03:00
…
…
…
2024-01-27 12:09:54 +01:00
2024-01-27 12:09:54 +01:00
2025-11-28 12:56:27 +02:00
2025-02-27 04:02:33 +01:00
2025-09-04 18:08:39 +03:00
2025-11-04 13:44:16 +01:00
2025-09-24 13:40:09 +03:00
2024-11-29 13:43:17 +02:00
…
…
2025-10-15 19:29:55 +11:00
2024-12-02 11:35:34 +02:00
2024-12-05 10:11:58 +01:00
2025-10-15 19:29:55 +11:00
2025-11-04 13:44:16 +01:00
2025-03-27 08:01:47 +02:00
2024-10-29 15:24:38 +01:00
2024-07-16 15:54:22 +08:00
2024-07-16 15:54:22 +08:00
2025-11-04 13:44:16 +01:00
2025-09-03 10:32:56 +03:00
2025-09-04 18:08:39 +03:00
2025-09-04 18:08:39 +03:00
2025-09-03 10:32:56 +03:00
2024-10-29 15:24:38 +01:00
2025-09-30 12:06:31 +03:00
2024-12-02 11:35:34 +02:00
2024-12-02 11:35:34 +02:00
2025-11-04 13:44:16 +01:00
2024-11-29 13:43:17 +02:00
2024-07-08 22:40:16 +02:00
2024-06-17 12:02:03 +03:00
2025-04-26 10:53:02 +02:00
2024-05-21 19:38:51 +02:00
2023-11-14 18:33:03 +01:00
…
2025-04-26 10:53:02 +02:00
2025-01-09 07:58:08 +02:00
2025-11-28 12:56:27 +02:00
2025-09-02 15:58:39 +02:00
2025-11-28 12:56:27 +02:00
…
…
2025-09-04 18:08:39 +03:00
…
2024-09-18 07:38:49 +03:00
2024-12-02 11:35:34 +02:00
2023-11-08 16:23:30 +01:00
2024-11-29 12:37:46 +02:00
2024-05-30 16:04:00 +03:00
2025-11-28 12:56:27 +02:00
2025-11-28 12:56:27 +02:00
2025-03-28 13:55:21 +02:00
2024-05-21 19:38:51 +02:00
2025-11-04 13:44:16 +01:00
2025-11-04 13:44:16 +01:00
2025-09-04 18:08:39 +03:00
2024-12-02 11:35:34 +02:00
2024-06-24 13:09:47 +03:00
2024-11-29 13:43:17 +02:00
2024-07-16 15:54:22 +08:00
2024-12-02 11:35:34 +02:00
…
2025-09-04 18:08:39 +03:00
2024-07-22 15:14:50 +02:00
2025-07-28 19:40:10 +02:00
2025-04-26 10:53:02 +02:00
2025-04-26 10:53:02 +02:00
2025-07-28 19:40:10 +02:00
2025-01-30 12:01:11 +01:00
2025-01-29 11:17:38 +01:00
2024-12-02 11:35:34 +02:00
2024-12-02 11:35:34 +02:00
…
2025-10-28 17:49:51 +01:00
2025-10-28 17:49:51 +01:00
2025-09-24 13:40:09 +03:00
2025-01-30 11:55:13 +01:00
2025-11-04 13:44:16 +01:00
2024-12-02 11:35:34 +02:00
2024-06-24 13:09:47 +03:00
2025-09-04 18:08:39 +03:00
2025-10-17 09:05:29 +03:00
2025-01-14 23:45:41 +01:00
2024-06-24 13:09:47 +03:00
2025-01-30 12:01:11 +01:00
2025-01-30 12:01:11 +01:00
2024-11-29 12:37:46 +02:00
2024-11-29 12:37:46 +02:00
2024-11-29 13:43:17 +02:00
2025-04-26 10:53:02 +02:00
2025-09-04 18:08:39 +03:00
2024-01-18 19:22:23 +02:00
2025-04-26 10:53:02 +02:00
2024-12-02 11:35:34 +02:00
2025-11-28 12:56:27 +02:00
2024-10-03 13:24:43 +03:00
2025-09-24 13:40:09 +03:00
2025-09-04 18:08:39 +03:00
2024-01-10 18:01:46 +11:00
2025-10-25 00:19:11 +07:00
2025-03-03 11:07:56 +02:00
2025-11-04 13:44:16 +01:00
…
2024-08-21 09:30:54 +02:00
2025-09-24 13:40:09 +03:00
2025-09-24 13:40:09 +03:00
2025-09-04 18:08:39 +03:00
2024-06-27 10:26:09 +03:00
2025-01-09 07:58:08 +02:00
2024-10-30 15:11:17 +01:00
2024-11-29 12:37:46 +02:00
…
2025-11-04 13:44:16 +01:00
2025-09-19 12:31:14 +03:00
2025-09-04 18:08:39 +03:00
2025-11-04 13:44:16 +01:00
2025-09-02 15:58:39 +02:00
2024-04-15 18:54:30 +02:00
2025-11-28 12:56:27 +02:00
2024-07-03 12:45:30 +02:00
2025-11-28 12:56:27 +02:00
2025-09-24 13:40:09 +03:00
2023-12-17 11:20:43 +01:00
2023-12-17 11:20:43 +01:00
2025-10-09 13:37:45 +03:00
2025-09-04 18:08:39 +03:00
2025-01-30 12:01:11 +01:00
2023-12-02 01:02:50 +01:00
2025-11-04 13:44:16 +01:00
2025-09-04 18:08:39 +03:00
2025-10-09 13:37:45 +03:00
2025-11-28 12:56:27 +02:00
2024-03-28 10:51:36 +02:00
2025-09-16 17:01:39 +03:00
2025-11-04 13:44:16 +01:00
2025-03-03 11:07:56 +02:00
2025-01-30 12:01:11 +01:00
2025-03-27 08:01:47 +02:00
…
2025-09-03 10:32:56 +03:00
2023-10-14 13:36:11 +03:00
2024-01-18 19:22:23 +02:00
2025-09-03 10:32:56 +03:00
2024-12-02 11:35:34 +02:00
2024-11-23 08:14:23 -07:00
2025-04-26 10:53:02 +02:00
2025-10-01 07:24:54 +03:00
2025-11-28 12:56:27 +02:00
…
2024-01-10 18:01:46 +11:00
2024-11-05 21:32:48 +01:00
2025-09-04 18:08:39 +03:00
2024-06-24 13:09:47 +03:00
2025-07-28 19:40:10 +02:00
…
2024-02-15 13:53:21 +01:00
2024-12-02 11:35:34 +02:00
2024-12-02 11:35:34 +02:00
2025-07-28 19:40:10 +02:00
2024-05-21 19:38:51 +02:00
2025-04-26 10:53:02 +02:00
2024-02-21 13:08:23 +02:00
2025-11-28 12:56:27 +02:00
2025-11-28 12:56:27 +02:00
2024-01-02 17:37:58 +02:00
2024-06-27 10:26:09 +03:00
2025-11-28 12:56:27 +02:00
2025-05-26 08:10:47 +03:00
2024-05-10 20:02:18 +02:00
2025-01-30 11:55:13 +01:00
2024-10-03 13:24:43 +03:00
2024-09-09 13:50:38 +03:00
2025-04-02 10:15:08 +03:00
2025-03-27 08:01:47 +02:00
2024-10-29 15:24:38 +01:00
2023-10-14 13:36:11 +03:00
2025-11-11 10:34:33 +02:00
2025-11-11 10:34:33 +02:00
2025-07-28 19:40:10 +02:00