0

Tell me please, where can I read about query optimization in a snowflake? maybe best practices? especially regarding left join

maybe a book or a video… previously i worked in sql server

can you explain which SQL script is better and why?

DELETE FROM dwh.sandbox.test WHERE EXISTS (SELECT NULL FROM DWH.SANDBOX._tmp_test s WHERE test.calculation_id = s.calculation_id )

OR

DELETE FROM dwh.sandbox.test t USING DWH.SANDBOX._tmp_test t2 WHERE t.calculation_id = t2.calculation_id

  • Please share specific use case, any query or slowness you experience. Remember that snowflake is a bit different then conventional RDBMSs in that it operates how data is distributed in micro partitions. Try looking into plan and see which part of the plan is fetching or returning more data and what filter you can use there to restrict or optimize it – Pankaj Mar 28 '22 at 21:49
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Mar 29 '22 at 05:52
  • https://docs.snowflake.com/en/user-guide/ui-query-profile.html – Felipe Hoffa Mar 30 '22 at 01:48
  • can you explain which SQL script is better and why? `DELETE FROM dwh.sandbox.test WHERE EXISTS (SELECT NULL FROM DWH.SANDBOX._tmp_test s WHERE test.calculation_id = s.calculation_id )` OR `DELETE FROM dwh.sandbox.test t USING DWH.SANDBOX._tmp_test t2 WHERE t.calculation_id = t2.calculation_id` – MaratKasumov Apr 08 '22 at 11:24

0 Answers0