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

Parallel execution increases UNION query execution time by 80%

    XMLWordPrintable

Details

    • Related to performance

    Description

      Union query execution time increases from 10ms to 18ms in Parallel mode of 100.
      Note:
      Perf improvement seen with less worker threads (2,4,8,16,32)

      Query:

      analyze ( SELECT t1.col_int_key, COUNT(*), SUM( t1.col_int ) FROM G t1 WHERE NOT t1.col_int > 1 GROUP BY t1.col_int_key ) UNION  ( SELECT t1.col_int_key, COUNT(*), SUM( t1.col_int ) FROM C t1 GROUP BY t1.col_int_key ) ;
      

      Serial : 0.010sec (10ms)
      Parallel (100 worker threads ): 0.018sec (18ms)

      For analyze output refer:
      serial : analyze-json.txt
      Parallel : analyze-json-PQ.txt

      Version details:

      ----------------------
      Branch: bb-13.2-MDEV-40012-refactored-input3
      Commit:1648b516083ccdbddeb123dc6cf2c2f62d7b0328
      Version:13.1.0

      How to repro:

      source tables.sql;
       
      //Run query with 0 and 100 threads and note the difference
      SET parallel_worker_threads=0;
      analyze ( SELECT t1.col_int_key, COUNT(*), SUM( t1.col_int ) FROM G t1 WHERE NOT t1.col_int > 1 GROUP BY t1.col_int_key ) UNION  ( SELECT t1.col_int_key, COUNT(*), SUM( t1.col_int ) FROM C t1 GROUP BY t1.col_int_key ) ; 
      

      Attachments

        1. analyze-json.txt
          39 kB
          Pavithra Pandith
        2. analyze-json-PQ.txt
          128 kB
          Pavithra Pandith
        3. tables.sql
          3.61 MB
          Pavithra Pandith

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              mariadb-pavithrapandith Pavithra Pandith
              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.