Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4563

Investigate and correct a CPU / elapsed anomaly with UNION

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • None
    • 6.1.1
    • PrimProc
    • None

    Description

      This was tested in 3 node cluster, with and without shared folders. The problem is that UNION takes far more than the sum of its branches. This is reflect in both elapsed and CPU time consumed by ExeMgr. See consolidated summary in the attachement, as well as an easy reproduction below.

      {{
      MariaDB [bts]> select count(year) from (select * from flights where year <2018) q;
      select count(year) from (select * from flights where year >2018) q;
      select count(year) from (select * from flights where year <2018 union all select * from flights where year>2018) q;-------------

      count(year)

      -------------

      17111358

      -------------
      1 row in set, 1 warning (2.189 sec)

      MariaDB [bts]> select count(year) from (select * from flights where year >2018) q;

      -------------

      count(year)

      -------------

      12717658

      -------------
      1 row in set, 1 warning (1.531 sec)

      MariaDB [bts]> select count(year) from (select * from flights where year <2018 union all select * from flights where year>2018) q;

      -------------

      count(year)

      -------------

      29829016

      -------------
      1 row in set, 1 warning (11.077 sec)

      MariaDB [bts]>
      MariaDB [bts]> select calgettrace();
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      calgettrace()

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Desc Mode Table TableOID ReferencedColumns PIO LIO PBE Elapsed Rows
      BPS PM flights 3028 (year) 0 6144 3272 10.821 17111358
      TNS UM - - - - - - 10.819 17111358
      BPS PM flights 3028 (year) 0 3272 6144 8.824 12717658
      TNS UM - - - - - - 8.967 12717658
      TUS UM - - - - - - 10.781 28241118
      TAS UM - - - - - - 10.714 1
      TNS UM - - - - - - 0.000 1

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      1 row in set (0.000 sec)
      }}

      Attachments

        Issue Links

          Activity

            People

              gdorman Gregory Dorman (Inactive)
              gdorman Gregory Dorman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.