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

Constant subqueries marked as unmergeable

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.4.33, 10.6.17
    • 10.6
    • Optimizer
    • None

    Description

      /*
        Check whether the merging algorithm can be used for this unit
       
        SYNOPSIS
          st_select_lex_unit::can_be_merged()
       
        DESCRIPTION
          We can apply merge algorithm for a unit if it is single SELECT with
          subqueries only in WHERE clauses or in ON conditions or in select list
          (we do not count SELECTs of underlying  views/derived tables/CTEs and
          second level subqueries) and we have no grouping, ordering, HAVING
          clause, aggregate functions, DISTINCT clause, LIMIT clause.
       
        RETURN
          FALSE - only temporary table algorithm can be used
          TRUE  - merge algorithm can be used
      */
       
      bool st_select_lex_unit::can_be_merged()
      {
        // TODO: do not forget implement case when select_lex.table_list.elements==0
      
      

      The comment isn't quite right, but constant queries are always mergeable and may or may not be marked that way.

      Attachments

        Activity

          People

            Johnston Rex Johnston
            Johnston Rex Johnston
            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.