[MDEV-24157] Optimizer trace: multi-part ranges are not printed correctly Created: 2020-11-06  Updated: 2020-11-10  Resolved: 2020-11-06

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Not a Bug Votes: 0
Labels: optimizer_trace


 Description   

Run this:

create table t1 (a int, b int, key(a,b));
insert into t1 values (1,1),(2,2);
set optimizer_trace=1;
explain select * from t1 where a in (5,6) and b >= 10;
select * from information_schema.optimizer_trace;

And observe

                  "analyzing_range_alternatives": {
                    "range_scan_alternatives": [
                      {
                        "index": "a",
                        "ranges": [
                          "(5,10) <= (a,b) <= (5)",
                          "(6,10) <= (a,b) <= (6)"
                        ],

The ranges look odd. Should the right side be (5, +inf) instead of (5) ?



 Comments   
Comment by Sergei Petrunia [ 2020-11-06 ]

OTOH, If one sees ... (a,b) <= (5) that can be interpreted as (a) <= (5) , and then the range is correct (note that both comparisons are less-or-equal).

Generated at Thu Feb 08 09:27:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.