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
- relates to
-
MCOL-704 backport to 1.0.9: MCOL-686 Using BETWEEN together with date functions in WHERE clause 100x slower than InfiniDB
-
- Closed
-