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

Optimizer Trace Replay: Q1 2026 Dev Sprint Work 1

    XMLWordPrintable

Details

    • Task
    • Status: In Progress (View Workflow)
    • Major
    • Resolution: Unresolved
    • 13.0
    • Optimizer
    • None
    • Q1/2026 Server Development

    Description

      Hook records_in_range call

      in opt_range.cc in ror_intersect_add() -> ror_scan_selectivity()
      , there is a handler->records_in_range() call.
      We need to hook it: save and return back its value.

      Note that ha_something::multi_range_read_info_const() as well as handler::multi_range_read_info_const() also make calls to handler->records_in_range() and we do NOT need to intercept them.

      Example query that uses index_merge/intersection and depends on records_in_range() value:

      INDEX i1(a, b)
      INDEX i2(a, c) 
      select * from t1 where a=1 and b=1 and c=1;
      

      or try INDEX(c,a), INDEX(b, a).

      Constant tables

      We need to save the rows we've read from constant tables.
      For the moment, let's take the path of least effort:
      We write {{CREATE TABLE ... }} statements into captured context.
      For constant tables, also write {{INSERT INTO tbl VALUES(...) }} statement.
      That way, we won't need any special replay code.

      Use this function for dumping table rows:

      String dbug_format_row(TABLE *table, const uchar *rec, bool print_names)
      

      Just make it do quoting.

      Attachments

        Issue Links

          Activity

            People

              bsrikanth Srikanth Bondalapati
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.