Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
5.5.1
-
None
Description
There appears to be a significant difference in the query execution times between the query Q1:
MariaDB [test]> select count(c1) from wide_table union all select 1; |
+-----------+ |
| count(c1) | |
+-----------+ |
| 1000000 |
|
| 1 |
|
+-----------+ |
2 rows in set (1.941 sec) |
And query Q2:
MariaDB [test]> select * from (select count(c1) from wide_table union all select 1) q; |
+-----------+ |
| count(c1) | |
+-----------+ |
| 1 |
|
| 1000000 |
|
+-----------+ |
2 rows in set (0.035 sec) |
Here, wide_table is a table with 100 INT columns. As can be seen, Q1 is 60x slower than Q2.
The difference is, Q2 runs using the ColumnStore select handler whereas Q1 does not. Q1's execution path calls mysql_union() in sql/sql_union.cc which currently does not support select handler. This needs to be fixed.
Attachments
Issue Links
- duplicates
-
MCOL-4901 Allow pushdown of queries involving UNIONs in outer select to ColumnStore
- Closed
- is caused by
-
MDEV-25080 Allow pushdown of queries involving UNIONs in outer select to foreign engines
- Closed
- relates to
-
MCOL-4569 Queries with UNION ALL perform disproportionally badly
- Closed