Goal | Find base tables in case of which the FILLFACTOR property has perhaps a too big value. Try to find base tables that probably encounter UPDATE operations. In the tables that have frequent updates you want to have free space in table pages (blocks) to accommodate new row versions, which the system automatically creates as a result of fulfilling UPDATE statements. If a new row version will be put to another page by the system, then it means that table indexes have to be updated as well. Thus, the more there are indexes, the more the table would benefit from keeping a new row version in the same page as the old version. |
Notes | The query assumes that if the FILLFACTOR has been changed to other value than 100 and then back to 100, then the corresponding reloption is still registered. There are more than one possible reloptions. Thus, instead of using the condition reloptions IS NOT NULL, the query filters out reloptions that specify a new FILLFACTOR value. The query considers both column names in English and Estonian. |
Type | Problem detection (Each row in the result could represent a flaw in the design) |
Reliability | Medium (Medium number of false-positive results) |
License | MIT License |
Fixing Suggestion | Change FILLFACTOR to 90 or 95. It does not have to be smaller because old versions of rows will be soon deleted from blocks by the vacuum process, i.e., it frees space. After changing the FILLFACTOR of an existing table, one has to VACUUM FULL the table to reorganize its internal storage. |
Data Source | INFORMATION_SCHEMA+system catalog |
SQL Query |
|
SQL statements that help generate fixes for the identified problem.
SQL Query to Generate Fix | Description |
---|---|
| Change the fillfactor to 90. |
This query belongs to the following collections:
Name | Description |
---|---|
Find problems automatically | Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not . |
This query is classified under the following categories:
Name | Description |
---|---|
Data at the database physical level | Queries of this category provide information about the disk usage. |
Performance | Queries of this category provide information about indexes in a database. |
Result quality depends on names | Queries of this category use names (for instance, column names) to try to guess the meaning of a database object. Thus, the goodness of names determines the number of false positive and false negative results. |
Further reading and related materials: