Created
October 9, 2024 12:32
-
-
Save datadutch/f1822627d1d265702ecbc832b8cd6e8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alter session set USE_CACHED_RESULT = FALSE; | |
alter session set query_tag = 'resultcache'; | |
use warehouse benchmark; | |
alter warehouse benchmark set warehouse_size = XSMALL; | |
select c.* | |
from cost.altimate.store_sales_price sp | |
join cost.altimate.customer c | |
on sp.ss_customer_sk = c.c_customer_sk | |
where c_birth_country like '%REP%' | |
limit 5000000; | |
-- 12 seconds | |
alter session set USE_CACHED_RESULT = TRUE; | |
select c.* | |
from cost.altimate.store_sales_price sp | |
join cost.altimate.customer c | |
on sp.ss_customer_sk = c.c_customer_sk | |
where c_birth_country like '%REP%' | |
limit 5000000; | |
-- 99 ms | |
-- adding non deterministic | |
select c.* | |
, current_timestamp() | |
from cost.altimate.store_sales_price sp | |
join cost.altimate.customer c | |
on sp.ss_customer_sk = c.c_customer_sk | |
where c_birth_country like '%REP%' | |
limit 5000000; | |
-- 7 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment