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

Bypass exact count optimization when in context replay mode

    XMLWordPrintable

Details

    Description

      optimizer today relies on empty or constant row table for several optimizations and also to even stop further execution of the query.

      However, when the optimizer context is being replayed, the table being created at the reproducing site would often be empty. If the query execution is stopped abruptly, then we wouldn't be able to replay the context properly. So, we need to add a check to make sure this level of optimization is to be done only in non-replay mode.

      Here are the pieces of code where the new check might have to be added: -

      opt_range.cc|6023| if (table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT)
      opt_sum.cc|73| or HA_STATS_RECORDS_IS_EXACT
      opt_sum.cc|315| if (!(tl->table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) ||
      sql_select.cc|5765| (table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT)) ||
      sql_select.cc|5809| (table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT)) ||
      sql_select.cc|5964| (table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) &&
      sql_select.cc|25961| (jt->table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) &&
      

      Attachments

        Issue Links

          Activity

            People

              bsrikanth Srikanth Bondalapati
              bsrikanth Srikanth Bondalapati
              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.