Details
- 
    
Bug
 - 
    Status: Closed (View Workflow)
 - 
    
Minor
 - 
    Resolution: Fixed
 - 
    1.0.8
 - 
    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
- 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
 
 -