Order by vs. cluster by #1283
Replies: 2 comments 1 reply
-
Noting we have some documentation on this |
Beta Was this translation helpful? Give feedback.
-
my understanding is: order by is part of a select statement and determines the interior order of the result set itself whether you’re storing it or simply retrieving it — this is not necessarily related to how it is split and stored across disks in snowflake’s servers though -- if often might be, but not always. cluster by, on the other hand, is a dml clause configuration purely related to the create/replace of objects — it does determine the way an object is split and stored across disks — these two could both be used in a statement together actually, but in 95% of cases you’re better off to let snowflake determine clustering on its own. for example, you could order by |
Beta Was this translation helpful? Give feedback.
-
What is the difference between
order by
&cluster by
and when to use one over the other?Beta Was this translation helpful? Give feedback.
All reactions