[MDEV-31493] Query with selectall is slower than select a specific column as it does not use the index Created: 2023-06-18 Updated: 2023-06-29 Resolved: 2023-06-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Chintan Thakkar | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Mariadb 11.0.2 |
||
| Description |
|
Adding below both explain queries with results.
|
| Comments |
| Comment by Sergei Golubchik [ 2023-06-29 ] |
|
see https://mariadb.com/kb/en/explain/#type-column "index" means "A full scan over the used index" and "Using index" means "Only the index is used to retrieve the needed information from the table" To use "only the index" all the columns that the query needs must be in the index. If you select columns that aren't in that index, "Using index" is not applicable |