r/SQL • u/No_Ambition8323 • Sep 04 '26
Discussion Database-Specific SQL Differences
Have you ever written a SQL query that works perfectly in one database but fails in another?
What SQL feature or syntax surprised you the most when switching between DBMSs like MySQL, PostgreSQL, SQL Server, Oracle, or Snowflake?
13
Upvotes
View all comments
Show parent comment
1
u/NastyPastyLucas Sep 05 '26
There is a very large asterisk there in that clustering is a one time operation, that will order the heap according to the index you nominate. Subsequent updates, inserts and deletes will still act on the table as if it were a heap. SQL Server clustering means that the physical table is stored in the primary key order, and that secondary indexes point to the primary index. Data alterations will not change the position of the data on disk on SQL Server clustered as they do on heap. The two are very different to one another.