Sample Header Ad - 728x90

Is default ordering affected by clustered index?

0 votes
2 answers
249 views
My colleague and I are debating whether the default ordering of rows from a SELECT statement (without specifying any ORDER BY) is controlled by the clustered index or not. He demoed this by creating a clustered index on a column with DESC, then SELECT would return the result according to that column as if there is a hidden ORDER BY column DESC. But I doubt this holds true as the table grows, even given we only ever INSERT into this table and never any UPDATE nor DELETE, however I can't prove this to him. Can anyone show a demo disproving this? We were testing this on Microsoft SQL Server, but the question is for any DBMS. In my case, there is only just one clustered index on the table.
Asked by user1589188 (151 rep)
Mar 25, 2024, 02:25 PM
Last activity: Mar 27, 2024, 09:24 AM