mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
29 lines
802 B
SQL
29 lines
802 B
SQL
SET optimize_move_to_prewhere = 1;
|
|
SET enable_multiple_prewhere_read_steps = 1;
|
|
|
|
SELECT explain
|
|
FROM (
|
|
EXPLAIN actions=1
|
|
SELECT SearchPhrase, MIN(URL), MIN(Title), COUNT(*) AS c, COUNT(DISTINCT UserID)
|
|
FROM test.hits
|
|
WHERE Title LIKE '%Google%' AND URL NOT LIKE '%.google.%' AND SearchPhrase <> ''
|
|
GROUP BY SearchPhrase
|
|
ORDER BY c DESC
|
|
LIMIT 10
|
|
SETTINGS allow_reorder_prewhere_conditions = 0
|
|
)
|
|
WHERE explain like '%Prewhere filter column%';
|
|
|
|
SELECT explain
|
|
FROM (
|
|
EXPLAIN actions=1
|
|
SELECT SearchPhrase, MIN(URL), MIN(Title), COUNT(*) AS c, COUNT(DISTINCT UserID)
|
|
FROM test.hits
|
|
WHERE Title LIKE '%Google%' AND URL NOT LIKE '%.google.%' AND SearchPhrase <> ''
|
|
GROUP BY SearchPhrase
|
|
ORDER BY c DESC
|
|
LIMIT 10
|
|
SETTINGS allow_reorder_prewhere_conditions = 1
|
|
)
|
|
WHERE explain like '%Prewhere filter column%';
|