Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Chunk index didn't carry over fillfactor from base table #7086

Open
pgloader opened this issue Jul 1, 2024 · 1 comment
Open

[Bug]: Chunk index didn't carry over fillfactor from base table #7086

pgloader opened this issue Jul 1, 2024 · 1 comment
Labels

Comments

@pgloader
Copy link

pgloader commented Jul 1, 2024

What type of bug is this?

Other

What subsystems and features are affected?

Other

What happened?

I have set fillfactor of an hypertable index as 60% . However, the index on the chunk didn't carry over the fillfactor

select t.relname as table_name, t.reloptions

from pg_class t
join pg_namespace n on n.oid = t.relnamespace
where t.relname in ('table_60_pkey', '46_35_table_60_pkey');
table_name | reloptions
---------------------------+-----------------
46_35_table_60_pkey |
table_60_pkey | {fillfactor=60}
(2 rows)

TimescaleDB version affected

2.15.2

PostgreSQL version used

16.3

What operating system did you use?

RHEL8.6

What installation method did you use?

Other

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

# select t.relname as table_name, t.reloptions
from pg_class t
  join pg_namespace n on n.oid = t.relnamespace
where t.relname in ('table_60_pkey', '46_35_table_60_pkey');
        table_name         |   reloptions
---------------------------+-----------------
 46_35_table_60_pkey |
 table_60_pkey       | {fillfactor=60}
(2 rows)

How can we reproduce the bug?

# select t.relname as table_name, t.reloptions
from pg_class t
  join pg_namespace n on n.oid = t.relnamespace
where t.relname in ('table_60_pkey', '46_35_table_60_pkey');
        table_name         |   reloptions
---------------------------+-----------------
 46_35_table_60_pkey |
 table_60_pkey       | {fillfactor=60}
(2 rows)
@pgloader pgloader added the bug label Jul 1, 2024
@akuzm
Copy link
Member

akuzm commented Jul 18, 2024

Could you please give a more detailed reproduction script for this? In the simple case, the fillfactor is inherited:

test=# create table ff(a int);
CREATE TABLE

test=# select create_hypertable('ff', 'a', create_default_indexes=> false);
NOTICE:  00000: adding not-null constraint to column "a"
DETAIL:  Dimensions cannot have NULL values.
LOCATION:  dimension_add_not_null_on_column, dimension.c:1152
 create_hypertable 
───────────────────
 (64,public,ff,t)

test=# create index on ff(a) with (fillfactor = 10);
CREATE INDEX

test=# insert into ff values (1);
INSERT 0 1

test=# explain select * from ff;
                               QUERY PLAN                                
─────────────────────────────────────────────────────────────────────────
 Seq Scan on _hyper_64_18462_chunk  (cost=0.00..35.50 rows=2550 width=4)

test=# \d _timescaledb_internal._hyper_64_18462_chunk
Table "_timescaledb_internal._hyper_64_18462_chunk"
 Column │  Type   │ Collation │ Nullable │ Default 
────────┼─────────┼───────────┼──────────┼─────────
 a      │ integer │           │ not null │ 
Indexes:
    "_hyper_64_18462_chunk_ff_a_idx" btree (a) WITH (fillfactor='10')
Check constraints:
    "constraint_12567" CHECK (a >= 0 AND a < 100000)
Inherits: ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants