1

I am trying to do some benchmarking for some query patterns. Multiple runs aren't very useful as snowflake returns the result immediately using QUERY RESULT REUSE node. Is there a way to force snowflake to re-compute the query?

Suspending and restarting a warehouse or using a new warehouse doesn't help with this.

2 Answers 2

3
alter session set USE_CACHED_RESULT = FALSE
2
  • To mark an answer as accepted, click on the check mark beside the answer. You may change which answer is accepted, or simply un-accept the answer, at any time. Commented Sep 22, 2023 at 15:44
  • I still want the cache effects to exist while benchmarking because that's closer to what the real case looks like
    – Gopick
    Commented Sep 25, 2023 at 5:47
0

I solved this by adding CURRENT_TIMESTAMP() as one of the projected columns. This forces the query optimizer to recompute results as the function isn't deterministic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.