top | item 20857007

(no title)

forcemajeure | 6 years ago

AFAIK it's also proportional to the number of rows with data in the indexed columns. Inserting a row with a NULL in the indexed column does not cause an update to the index (at least experimentally it doesn't seem to contribute to index size on SQL Server).

I imagine this is/was a simple optimization for DBMS to implement, but I would love to be corrected otherwise...

discuss

order

philliphaydon|6 years ago

If you change a value to null it’s still a row allocated in the index. The index size won’t shrink unless you rebuild it. Removing and deleting data will just end up with fragmentation.