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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.8
    • Fix Version/s: 1.1.0
    • Component/s: Connector
    • Labels:
      None
    • Environment:
      centos7
    • Sprint:
      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

              Assignee:
              dleeyh Daniel Lee
              Reporter:
              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.