ClickHouse/tests/queries/0_stateless/02494_query_result_cache_explain.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
1017 B
MySQL
Raw Normal View History

2023-01-10 23:09:14 +00:00
-- Tags: no-parallel
SYSTEM DROP QUERY RESULT CACHE;
-- Run a silly query with a non-trivial plan and put the result into the query result cache (QRC)
SELECT 1 + number from system.numbers LIMIT 1 SETTINGS enable_experimental_query_result_cache = true;
SELECT count(*) FROM system.query_result_cache;
-- EXPLAIN PLAN should show the same regardless if the result is calculated or read from the QRC
EXPLAIN PLAN SELECT 1 + number from system.numbers LIMIT 1;
EXPLAIN PLAN SELECT 1 + number from system.numbers LIMIT 1 SETTINGS enable_experimental_query_result_cache = true; -- (*)
-- EXPLAIN PIPELINE should show the same regardless if the result is calculated or read from the QRC
EXPLAIN PIPELINE SELECT 1 + number from system.numbers LIMIT 1;
EXPLAIN PIPELINE SELECT 1 + number from system.numbers LIMIT 1 SETTINGS enable_experimental_query_result_cache = true; -- (*)
-- Statements (*) must not cache their results into the QRC
SELECT count(*) FROM system.query_result_cache;
SYSTEM DROP QUERY RESULT CACHE;