Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24157

Optimizer trace: multi-part ranges are not printed correctly

    XMLWordPrintable

    Details

      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) ?

        Attachments

          Activity

            People

            Assignee:
            psergei Sergei Petrunia
            Reporter:
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration