[MDEV-10175] range optimizer calls records_in_range() for full extended keys Created: 2016-06-03  Updated: 2016-07-12  Resolved: 2016-06-03

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1
Fix Version/s: 10.1.15

Type: Bug Priority: Minor
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-9764 MariaDB does not limit memory used fo... Closed
relates to MDEV-10046 InnoDB Range Optimizer Regression Open

 Description   

Debugging MDEV-10046, I have discovered that range optimizer will call records_in_range() when we have a full equality range for an extended index.

Example:

create table t1 (
  pk int primary key,
  col1 int,
  ...
  index IDX1(col1)
);

explain select * from t1 where col1 IN (c11, c12, ...) and pk IN (c21, c22, ..)

Here, when doing range analysis for IDX1, we get ranges in form:

(col1, pk)= (c11, c21)

When PK is a part of the index, there is no need to call records_in_range: we don't call it for unique indexes, InnoDB internally is set to return 1 when it sees a zero estimate.


Generated at Thu Feb 08 07:40:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.