Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4569 Queries with UNION ALL perform disproportionally badly
  3. MCOL-4589

Optimize out columns in a subquery involving a UNION which are not referenced in the outer select

Details

    • Sub-Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 5.6.1
    • MDB Plugin
    • None
    • 2021-4

    Description

      This task is similar to MCOL-4543, but for subqueries involving a UNION. I.e., If query Q1 is of the form:

      SELECT count(c2) FROM (SELECT * FROM t1 UNION ALL SELECT * FROM t1)q;
      

      Assuming t1 here contains 10 columns c1, c2, ... , c10. We build an ineffective RowGroup in ExeMgr of the form (1, c2_value1, 1, 1, 1, 1, 1, 1, 1, 1). The objective here is to remove all non-referenced columns from the end, until the first referenced column is encountered, i.e. trim down the RowGroup to (1, c2_value1).

      Attachments

        Activity

          Build verified: 5.6.1 ( Drone #2207 )

          Tested on a 1gb dbt3 database

          5.5.2-1

          MariaDB [tpch1]> SELECT count(l_orderkey) FROM (SELECT * FROM lineitem UNION ALL SELECT * FROM lineitem) q;
          +-------------------+
          | count(l_orderkey) |
          +-------------------+
          |          12002430 |
          +-------------------+
          1 row in set (7.106 sec)
          

          5.6.1

          MariaDB [tpch1]> SELECT count(l_orderkey) FROM (SELECT * FROM lineitem UNION ALL SELECT * FROM lineitem) q;
          +-------------------+
          | count(l_orderkey) |
          +-------------------+
          |          12002430 |
          +-------------------+
          1 row in set (1.731 sec)
          

          dleeyh Daniel Lee (Inactive) added a comment - Build verified: 5.6.1 ( Drone #2207 ) Tested on a 1gb dbt3 database 5.5.2-1 MariaDB [tpch1]> SELECT count(l_orderkey) FROM (SELECT * FROM lineitem UNION ALL SELECT * FROM lineitem) q; +-------------------+ | count(l_orderkey) | +-------------------+ | 12002430 | +-------------------+ 1 row in set (7.106 sec) 5.6.1 MariaDB [tpch1]> SELECT count(l_orderkey) FROM (SELECT * FROM lineitem UNION ALL SELECT * FROM lineitem) q; +-------------------+ | count(l_orderkey) | +-------------------+ | 12002430 | +-------------------+ 1 row in set (1.731 sec)

          People

            dleeyh Daniel Lee (Inactive)
            tntnatbry Gagan Goel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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