Skip to content

Comments

Fixed an issue where the default fillfactor value for B-tree indexes was incorrect. #9648#9653

Open
pravesh-sharma wants to merge 2 commits intopgadmin-org:masterfrom
pravesh-sharma:GH-9648
Open

Fixed an issue where the default fillfactor value for B-tree indexes was incorrect. #9648#9653
pravesh-sharma wants to merge 2 commits intopgadmin-org:masterfrom
pravesh-sharma:GH-9648

Conversation

@pravesh-sharma
Copy link
Contributor

@pravesh-sharma pravesh-sharma commented Feb 20, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted default index fillfactor values to improve storage utilization and consistency: B‑tree defaults reduced, hash set lower, and specialized index types aligned—resulting in more efficient page usage and steadier index behavior across index types.

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Change default fillfactor handling: B-tree default reduced from 100 to 90, hash default set to 75, and spgist default set to 90 across index properties templates and corresponding test SQL files.

Changes

Cohort / File(s) Summary
B-tree index tests
web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/11_plus/create_btree_desc_null_first.sql, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/create_btree_desc_null_first.sql, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/create_btree_desc_null_first.sql, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/alter_reset_fillfactor_cluster.sql, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/alter_reset_fillfactor_cluster.sql
Reduced fillfactor value from 100 to 90 in B-tree index CREATE/ALTER statements in tests.
Hash index test
web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql
Added WITH (fillfactor=75) to the hash index creation test.
Index properties templates
web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql
Updated logic mapping index access methods to default fillfactor: btree → 90 (was 100), hash → 75 (new), spgist → 90 (new/explicit); gist remains 90; else behavior adjusted accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • anilsahoo20
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: correcting the default fillfactor value for B-tree indexes from 100 to 90 across multiple test files and property files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql`:
- Around line 47-48: The CASE branch defaults for index fillfactor are wrong:
update the WHEN 'hash' and WHEN 'spgist' branches in the properties.sql CASE
that returns default fillfactor so that 'hash' returns 75 and 'spgist' returns
80 (replace the current 90 values in the WHEN 'hash' and WHEN 'spgist' cases) to
match PostgreSQL's HASH_DEFAULT_FILLFACTOR and SPGIST_DEFAULT_FILLFACTOR.

---

Duplicate comments:
In
`@web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql`:
- Around line 53-54: The CASE branch defaults for index access methods are
incorrect: change the WHEN 'hash' THEN 90 branch to WHEN 'hash' THEN 75 to match
PostgreSQL's actual default, and verify/correct the WHEN 'spgist' THEN 90 branch
to whatever PostgreSQL's SP-GiST default is (update the WHEN 'spgist' THEN
<correct_value> accordingly); locate these clauses by searching for the WHEN
'hash' and WHEN 'spgist' branches in the properties.sql CASE that maps access
methods to default fillfactor values and update the numeric literals to the
verified defaults.

In
`@web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql`:
- Around line 54-55: Update the default cost for the 'hash' index type in the
SQL templates so all versions use the correct value: replace the WHEN 'hash'
THEN 90 occurrence in templates 11_plus, 13_plus and 15_plus (the WHEN 'hash'
THEN branches in properties.sql) with the intended default (use 100 to match the
other templates), ensuring the WHEN 'spgist' THEN 90 entry remains unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant