From 719996794955151e3f5ec9ad67c8a50e73493f1e Mon Sep 17 00:00:00 2001 From: pravesh-sharma Date: Fri, 20 Feb 2026 11:56:57 +0530 Subject: [PATCH 1/2] Fixed an issue where the default fillfactor value for B-tree indexes was incorrect. #9648 --- .../indexes/tests/11_plus/create_btree_desc_null_first.sql | 2 +- .../tests/13_plus/alter_reset_fillfactor_cluster.sql | 2 +- .../indexes/tests/13_plus/create_btree_desc_null_first.sql | 2 +- .../tests/15_plus/alter_reset_fillfactor_cluster.sql | 2 +- .../indexes/tests/15_plus/create_btree_desc_null_first.sql | 2 +- .../tables/indexes/tests/default/create_hash_index.sql | 1 + .../tables/templates/indexes/sql/11_plus/properties.sql | 6 ++++-- .../tables/templates/indexes/sql/13_plus/properties.sql | 4 +++- .../tables/templates/indexes/sql/15_plus/properties.sql | 4 +++- 9 files changed, 16 insertions(+), 9 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/11_plus/create_btree_desc_null_first.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/11_plus/create_btree_desc_null_first.sql index 329cc493d8a..edbf94695cc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/11_plus/create_btree_desc_null_first.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/11_plus/create_btree_desc_null_first.sql @@ -6,5 +6,5 @@ CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" ON public.test_table_for_indexes USING btree (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST) INCLUDE(name, id) - WITH (fillfactor=100) + WITH (fillfactor=90) TABLESPACE pg_default; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/alter_reset_fillfactor_cluster.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/alter_reset_fillfactor_cluster.sql index 562e2f5b4e8..57769f60308 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/alter_reset_fillfactor_cluster.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/alter_reset_fillfactor_cluster.sql @@ -6,7 +6,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS "Idx1_$%{}[]()&*^!@""'`\/#" ON public.test_table_for_indexes USING btree (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST) INCLUDE(name, id) - WITH (fillfactor=100, deduplicate_items=True) + WITH (fillfactor=90, deduplicate_items=True) TABLESPACE pg_default; COMMENT ON INDEX public."Idx1_$%{}[]()&*^!@""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/create_btree_desc_null_first.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/create_btree_desc_null_first.sql index a3a7314274d..c46c14ddb7f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/create_btree_desc_null_first.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/13_plus/create_btree_desc_null_first.sql @@ -6,5 +6,5 @@ CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" ON public.test_table_for_indexes USING btree (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST) INCLUDE(name, id) - WITH (fillfactor=100, deduplicate_items=True) + WITH (fillfactor=90, deduplicate_items=True) TABLESPACE pg_default; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/alter_reset_fillfactor_cluster.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/alter_reset_fillfactor_cluster.sql index ad9e9041265..62eca8bb1e9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/alter_reset_fillfactor_cluster.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/alter_reset_fillfactor_cluster.sql @@ -7,7 +7,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS "Idx1_$%{}[]()&*^!@""'`\/#" (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST) INCLUDE(name, id) NULLS NOT DISTINCT - WITH (fillfactor=100, deduplicate_items=True) + WITH (fillfactor=90, deduplicate_items=True) TABLESPACE pg_default; COMMENT ON INDEX public."Idx1_$%{}[]()&*^!@""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/create_btree_desc_null_first.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/create_btree_desc_null_first.sql index a9e1019d973..bf6628dbe04 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/create_btree_desc_null_first.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/15_plus/create_btree_desc_null_first.sql @@ -7,5 +7,5 @@ CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST) INCLUDE(name, id) NULLS NOT DISTINCT - WITH (fillfactor=100, deduplicate_items=True) + WITH (fillfactor=90, deduplicate_items=True) TABLESPACE pg_default; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql index 1f64067e888..901b36dad15 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql @@ -5,4 +5,5 @@ CREATE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" ON public.test_table_for_indexes USING hash (id) + WITH (fillfactor=90) TABLESPACE pg_default; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql index b2129f84c1b..faf33aeed97 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql @@ -42,8 +42,10 @@ SELECT DISTINCT ON (cls.relname) COALESCE( substring(array_to_string(cls.reloptions, ',') FROM 'fillfactor=([0-9]*)')::int, CASE am.amname - WHEN 'btree' THEN 100 - WHEN 'gist' THEN 90 + WHEN 'btree' THEN 90 + WHEN 'gist' THEN 90 + WHEN 'hash' THEN 90 + WHEN 'spgist' THEN 90 ELSE NULL END ) AS fillfactor, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql index 2ce7f9d2410..04554bc3fa4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql @@ -48,8 +48,10 @@ SELECT DISTINCT ON (cls.relname) COALESCE( substring(array_to_string(cls.reloptions, ',') FROM 'fillfactor=([0-9]*)')::int, CASE am.amname - WHEN 'btree' THEN 100 + WHEN 'btree' THEN 90 WHEN 'gist' THEN 90 + WHEN 'hash' THEN 90 + WHEN 'spgist' THEN 90 ELSE NULL END ) AS fillfactor, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql index 9b9be97c8f5..17e4d73232f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql @@ -49,8 +49,10 @@ SELECT DISTINCT ON (cls.relname) COALESCE( substring(array_to_string(cls.reloptions, ',') FROM 'fillfactor=([0-9]*)')::int, CASE am.amname - WHEN 'btree' THEN 100 + WHEN 'btree' THEN 90 WHEN 'gist' THEN 90 + WHEN 'hash' THEN 90 + WHEN 'spgist' THEN 90 ELSE NULL END ) AS fillfactor, From 7549f7c09cf9eca90e019dc4cdff9fd4822bdd84 Mon Sep 17 00:00:00 2001 From: pravesh-sharma Date: Fri, 20 Feb 2026 14:54:56 +0530 Subject: [PATCH 2/2] Fixed review comments --- .../schemas/tables/indexes/tests/default/create_hash_index.sql | 2 +- .../schemas/tables/templates/indexes/sql/11_plus/properties.sql | 2 +- .../schemas/tables/templates/indexes/sql/13_plus/properties.sql | 2 +- .../schemas/tables/templates/indexes/sql/15_plus/properties.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql index 901b36dad15..9c820b9a67f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql @@ -5,5 +5,5 @@ CREATE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" ON public.test_table_for_indexes USING hash (id) - WITH (fillfactor=90) + WITH (fillfactor=75) TABLESPACE pg_default; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql index faf33aeed97..6bea7a96898 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/properties.sql @@ -44,7 +44,7 @@ SELECT DISTINCT ON (cls.relname) CASE am.amname WHEN 'btree' THEN 90 WHEN 'gist' THEN 90 - WHEN 'hash' THEN 90 + WHEN 'hash' THEN 75 WHEN 'spgist' THEN 90 ELSE NULL END diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql index 04554bc3fa4..21bca07630e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/13_plus/properties.sql @@ -50,7 +50,7 @@ SELECT DISTINCT ON (cls.relname) CASE am.amname WHEN 'btree' THEN 90 WHEN 'gist' THEN 90 - WHEN 'hash' THEN 90 + WHEN 'hash' THEN 75 WHEN 'spgist' THEN 90 ELSE NULL END diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql index 17e4d73232f..1b0f7be75a5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/15_plus/properties.sql @@ -51,7 +51,7 @@ SELECT DISTINCT ON (cls.relname) CASE am.amname WHEN 'btree' THEN 90 WHEN 'gist' THEN 90 - WHEN 'hash' THEN 90 + WHEN 'hash' THEN 75 WHEN 'spgist' THEN 90 ELSE NULL END