[MCOL-686] Using BETWEEN together with date functions in WHERE clause 100x slower than InfiniDB Created: 2017-04-27 Updated: 2017-05-08 Resolved: 2017-05-04 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MDB Plugin |
| Affects Version/s: | 1.0.8 |
| Fix Version/s: | 1.1.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Geoff Cleaves | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
centos7 |
||
| Issue Links: |
|
||||||||
| Sprint: | 2017-9 | ||||||||
| Description |
|
Something strange is happening, perhaps partition trimming is getting confused. The problem does not exist in IDB 4.6.
The three queries return the same results. |
| Comments |
| Comment by Geoff Cleaves [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This can certainly be worked around but unfortunately we have many stored queries using the BETWEEN keyword. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm not 100% sure from a quick debug but it appears BETWEEN with a pushed down cache function is failing to evaluate the function before it hits PrimProc. Therefore blocking any extent elimination from occurring. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Pierre Coustilas [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I test with my database,
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Found the cause. We are executing BETWEEN as a nondeterministic function rather than a predicate. I have a prototype of a patch ready I'm testing now | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Changed from 'critical' to 'minor' as this is a performance regression since InfiniDB. This is not a security/crashing bug, erroneous behaviour or a behaviour regression since ColumnStore GA. This will not affect the fact that I'm already working on this but helps the rest of my team. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Cleaves [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks. When I originally filed the issue I thought that I was getting incorrect result but in fact only slow results. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-04-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pull request for 1.1 only for now as there is a regression risk (although regression suite passes) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2017-05-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build tested: Github source Reproduced the issue in 1.0.8-1 using a 10g lineitem table with 59986052 rows: MariaDB [tpch1]> select count(l_linenumber) from lineitem where l_shipdate between current_date() and current_date();
---------------------
---------------------
---------------------
--------------------- In 1.1.0-1, the two queries took the same amount of time to execute
---------------------
---------------------
---------------------
--------------------- |