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

SET STATEMENT optimizer_record_context doesn't work.

    XMLWordPrintable

Details

    • Q2/2026 Server Development, Q3/2026 Server Maintenance

    Description

      set statement optimizer_record_context=1 for ... doesn't seem to have any effect.

      Test case:

      --source include/have_sequence.inc
       
      create table t1 (
        a int,
        b int,
        index (a)
      );
       
      insert into t1 select seq, seq from seq_1_to_1000;
       
      set statement optimizer_record_context=1 for 
      explain select * from t1 where a < 10; 
      select * from information_schema.optimizer_context;
      

      produces nothing.
      If I put a breakpoint in Optimizer_context_recorder::record_multi_range_read_info_const, it is not hit, that is, no recording takes place.

      For comparison:

      set statement optimizer_trace=1 for 
      explain select * from t1 where a < 10; 
      select * from information_schema.optimizer_trace;
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.