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

Using BETWEEN together with date functions in WHERE clause 100x slower than InfiniDB

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.0.8
    • 1.1.0
    • MDB Plugin
    • None
    • centos7
    • 2017-9

    Description

      Something strange is happening, perhaps partition trimming is getting confused. The problem does not exist in IDB 4.6.

      /* this is SLOW (27s) because 
         it combines BETWEEN and date function
      */
      SELECT 
       SUM(impressions)
      FROM
       action_date_hour
      WHERE
       action_date BETWEEN CURRENT_DATE() AND CURRENT_DATE()
      

      /* this is fast (0.23s) because no BETWEEN */
      SELECT 
       SUM(impressions)
      FROM
       action_date_hour
      WHERE
       action_date >= CURRENT_DATE() 
        AND action_date <= CURRENT_DATE()
      

      /* this is fast, no function in where */
      SET @startDate=current_date();
      SET @endDate=current_date();
      SELECT 
       SUM(impressions)
      FROM
       action_date_hour
      WHERE
       action_date BETWEEN @startDate AND @endDate
      

      The three queries return the same results.

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              gcleaves Geoff Cleaves
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.