If I don’t include an ORDER BY clause, how does CockroachDB return the results of a query? Sorted by the primary key? All of my tests seem to indicate that’s the case, but want to make sure before continuing development.
If you do not specify an ORDER BY clause in your query, it’s very possible your rows will return in an arbitrary order and not distinctly ordered by the table’s primary key. If you care about the order, always include an ORDER BY clause on the columns you want the results ordered by.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more