April 2018
Intermediate to advanced
508 pages
15h 22m
English
When you create a new index, not every entry in every index block is used. A small amount of free space, specified by the FILLFACTOR parameter, is left empty. The idea is that the first set of changes to that index either updates or insertions can happen on the same index blocks, therefore reducing index fragmentation.
The default FILLFACTOR for B-tree indexes is 90%, leaving 10% free space. One situation where you might want to change this is a table with static data, where the data won't change after index creation. In this case, creating the index to be 100% full is more efficient:
CREATE INDEX i ON t(v) WITH (FILLFACTOR=100);
On tables that are being populated randomly, or ones that are heavily updated, reducing the fillfactor ...
Read now
Unlock full access