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]: Upgrade to tsdb 2.15.1 caused selects by partitioned column to return only data after upgrade #6976

Closed
gugu opened this issue May 30, 2024 · 19 comments · Fixed by #6996
Labels

Comments

@gugu
Copy link

gugu commented May 30, 2024

What type of bug is this?

Incorrect result

What subsystems and features are affected?

Query planner

What happened?

After upgrade timescaledb 2.14 => 2.15.1 it recreated chunks for partitioned table and does not use old chunks if I run a query with filter by partitioned column.

Example:

explain select * from clicks; -- or explain select * from clicks where path="abc123" or any other column except of host
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                  QUERY PLAN                                                  │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Append  (cost=0.09..123102706.86 rows=21086364330 width=234)                                                 │
│   ->  Custom Scan (DecompressChunk) on _hyper_109_1710_chunk  (cost=0.09..6957.39 rows=73939000 width=189)   │
│         ->  Seq Scan on compress_hyper_110_1796_chunk  (cost=0.00..6957.39 rows=73939 width=738)             │
│   ->  Custom Scan (DecompressChunk) on _hyper_109_1711_chunk  (cost=0.09..6748.88 rows=71288000 width=185)   │
│         ->  Seq Scan on compress_hyper_110_1797_chunk  (cost=0.00..6748.88 rows=71288 width=739)             │
... a lot of rows ...
│         ->  Seq Scan on compress_hyper_110_4224_chunk  (cost=0.00..9271.80 rows=98980 width=740)             │
│   ->  Custom Scan (DecompressChunk) on _hyper_109_4182_chunk  (cost=0.09..10431.88 rows=116988000 width=226) │
│         ->  Seq Scan on compress_hyper_110_4225_chunk  (cost=0.00..10431.88 rows=116988 width=739)           │
│   ->  Custom Scan (DecompressChunk) on _hyper_109_4183_chunk  (cost=0.09..10440.40 rows=116540000 width=219) │
│         ->  Seq Scan on compress_hyper_110_4226_chunk  (cost=0.00..10440.40 rows=116540 width=740)           │
│   ->  Seq Scan on _hyper_109_4221_chunk  (cost=0.00..3086127.99 rows=63937299 width=257)                     │
│   ->  Seq Scan on _hyper_109_4222_chunk  (cost=0.00..2920222.23 rows=70022323 width=203)                     │
│   ->  Seq Scan on _hyper_109_4223_chunk  (cost=0.00..3095224.62 rows=67223062 width=235)                     │
│   ->  Seq Scan on _hyper_109_4227_chunk  (cost=0.00..1597918.62 rows=34093962 width=240)                     │
│   ->  Seq Scan on _hyper_109_4228_chunk  (cost=0.00..1752157.40 rows=35249440 width=267)                     │
│   ->  Seq Scan on _hyper_109_4229_chunk  (cost=0.00..1338665.29 rows=31861429 width=206)                     │
│   ->  Seq Scan on _hyper_109_4248_chunk  (cost=0.00..681713.28 rows=13944328 width=262)                      │
│   ->  Seq Scan on _hyper_109_4249_chunk  (cost=0.00..598661.20 rows=14026520 width=213)                      │
│   ->  Seq Scan on _hyper_109_4250_chunk  (cost=0.00..618311.67 rows=13414967 width=237)                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(430 rows)

> explain select * from clicks where dt > '2024-05-23';
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                              QUERY PLAN                                                              │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Append  (cost=0.00..17804064.18 rows=300290960 width=235)                                                                            │
│   ->  Seq Scan on _hyper_109_4221_chunk  (cost=0.00..3245971.24 rows=51750309 width=257)                                             │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│   ->  Index Scan using _hyper_109_4222_chunk_clicks_dt_idx on _hyper_109_4222_chunk  (cost=0.57..2880473.23 rows=53102248 width=203) │
│         Index Cond: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                        │
│   ->  Index Scan using _hyper_109_4223_chunk_clicks_dt_idx on _hyper_109_4223_chunk  (cost=0.57..3207809.53 rows=52311573 width=235) │
│         Index Cond: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                        │
│   ->  Seq Scan on _hyper_109_4227_chunk  (cost=0.00..1683153.52 rows=34093962 width=240)                                             │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│   ->  Seq Scan on _hyper_109_4228_chunk  (cost=0.00..1840281.00 rows=35249440 width=267)                                             │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│   ->  Seq Scan on _hyper_109_4229_chunk  (cost=0.00..1418318.86 rows=31861429 width=206)                                             │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│   ->  Seq Scan on _hyper_109_4248_chunk  (cost=0.00..726679.65 rows=14128852 width=261)                                              │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│   ->  Seq Scan on _hyper_109_4249_chunk  (cost=0.00..641548.45 rows=14215796 width=213)                                              │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│   ->  Seq Scan on _hyper_109_4250_chunk  (cost=0.00..658373.89 rows=13577351 width=236)                                              │
│         Filter: (dt > '2024-05-23 00:00:00+00'::timestamp with time zone)                                                            │
│ JIT:                                                                                                                                 │
│   Functions: 18                                                                                                                      │
│   Options: Inlining true, Optimization true, Expressions true, Deforming true                                                        │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(22 rows)

> explain select * from clicks where host='REDACTED';
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                          QUERY PLAN                                                          │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Index Scan using _hyper_109_4249_chunk_clicks_host_dt_idx on _hyper_109_4249_chunk  (cost=0.56..1320.00 rows=1177 width=213) │
│   Index Cond: (host = 'REDACTED'::text)                                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(2 rows)

Table structure:

127.0.0.1:15301 stats@stats=> \d clicks
                             Table "public.clicks"
┌─────────────────┬──────────────────────────┬───────────┬──────────┬─────────┐
│     Column      │           Type           │ Collation │ Nullable │ Default │
├─────────────────┼──────────────────────────┼───────────┼──────────┼─────────┤
│ host            │ text                     │           │ not null │         │
│ path            │ text                     │           │          │         │
│ lcpath          │ text                     │           │          │         │
│ method          │ http_method              │           │          │         │
│ url             │ text                     │           │          │         │
│ dt              │ timestamp with time zone │           │ not null │         │
│ st              │ smallint                 │           │          │         │
│ ip              │ inet                     │           │          │         │
│ proto           │ http_proto               │           │          │         │
│ ref             │ text                     │           │          │         │
│ human           │ boolean                  │           │ not null │         │
│ browser         │ text                     │           │          │         │
│ browser_version │ text                     │           │          │         │
│ country         │ character varying(2)     │           │          │         │
│ city            │ integer                  │           │          │         │
│ social          │ text                     │           │          │         │
│ refhost         │ text                     │           │          │         │
│ os              │ text                     │           │          │         │
│ utm_source      │ text                     │           │          │         │
│ utm_medium      │ text                     │           │          │         │
│ utm_campaign    │ text                     │           │          │         │
│ goal_completed  │ boolean                  │           │          │         │
│ ab_path         │ boolean                  │           │          │         │
└─────────────────┴──────────────────────────┴───────────┴──────────┴─────────┘
Indexes:
    "clicks_dt_host_human_idx" btree (host, dt) WHERE human
    "clicks_dt_host_lcpath_idx" btree (host, lcpath, dt)
    "clicks_dt_host_path_idx" btree (host, path, dt)
    "clicks_dt_idx" btree (dt DESC)
    "clicks_host_dt_idx" btree (host, dt DESC)
Check constraints:
    "clicks_country_check" CHECK (country::text ~ '^[a-zA-Z]{2}$'::text)
Triggers:
    ts_cagg_invalidation_trigger AFTER INSERT OR DELETE OR UPDATE ON clicks FOR EACH ROW EXECUTE FUNCTION _timescaledb_functions.continuous_agg_invalidation_trigger('109')
    ts_insert_blocker BEFORE INSERT ON clicks FOR EACH ROW EXECUTE FUNCTION _timescaledb_functions.insert_blocker()
Number of child tables: 219 (Use \d+ to list them.)

List of latest chunks:

SELECT a.*, is_compressed, pg_size_pretty(total_bytes), range_start, range_end FROM chunks_detailed_size('clicks') a join timescaledb_information.chunks on chunks.chunk_name=a.chunk_name where chunk_tablespace is null order by range_start;                                                                                                                                                                                           ┌───────────────────────┬───────────────────────┬─────────────┬─────────────┬─────────────┬─────────────┬───────────┬───────────────┬────────────────┬────────────────────────┬────────────────────────┐
│     chunk_schema      │      chunk_name       │ table_bytes │ index_bytes │ toast_bytes │ total_bytes │ node_name │ is_compressed │ pg_size_pretty │      range_start       │       range_end        │
├───────────────────────┼───────────────────────┼─────────────┼─────────────┼─────────────┼─────────────┼───────────┼───────────────┼────────────────┼────────────────────────┼────────────────────────┤
│ _timescaledb_internal │ _hyper_109_4103_chunk │    81428480 │     5070848 │  3046055936 │  3132555264 │ ∅         │ t             │ 2987 MB        │ 2024-05-07 00:00:00+00 │ 2024-05-12 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4105_chunk │    78290944 │     4866048 │  1981874176 │  2065031168 │ ∅         │ t             │ 1969 MB        │ 2024-05-07 00:00:00+00 │ 2024-05-12 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4104_chunk │    91594752 │     5914624 │  2859294720 │  2956804096 │ ∅         │ t             │ 2820 MB        │ 2024-05-07 00:00:00+00 │ 2024-05-12 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4160_chunk │    74047488 │     4792320 │  3021463552 │  3100303360 │ ∅         │ t             │ 2957 MB        │ 2024-05-12 00:00:00+00 │ 2024-05-17 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4159_chunk │    69591040 │     4448256 │  1955905536 │  2029944832 │ ∅         │ t             │ 1936 MB        │ 2024-05-12 00:00:00+00 │ 2024-05-17 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4158_chunk │    77758464 │     5169152 │  2481512448 │  2564440064 │ ∅         │ t             │ 2446 MB        │ 2024-05-12 00:00:00+00 │ 2024-05-17 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4183_chunk │    76029952 │     4882432 │  2587377664 │  2668290048 │ ∅         │ t             │ 2545 MB        │ 2024-05-17 00:00:00+00 │ 2024-05-22 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4181_chunk │    67895296 │     4194304 │  1766473728 │  1838563328 │ ∅         │ t             │ 1753 MB        │ 2024-05-17 00:00:00+00 │ 2024-05-22 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4182_chunk │    75923456 │     4767744 │  3547029504 │  3627720704 │ ∅         │ t             │ 3460 MB        │ 2024-05-17 00:00:00+00 │ 2024-05-22 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4222_chunk │ 18191228928 │ 21379481600 │   130826240 │ 39701536768 │ ∅         │ f             │ 37 GB          │ 2024-05-22 00:00:00+00 │ 2024-05-27 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4223_chunk │ 19854655488 │ 21137686528 │    63135744 │ 41055477760 │ ∅         │ f             │ 38 GB          │ 2024-05-22 00:00:00+00 │ 2024-05-27 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4221_chunk │ 20049281024 │ 18916802560 │    17915904 │ 38983999488 │ ∅         │ f             │ 36 GB          │ 2024-05-22 00:00:00+00 │ 2024-05-27 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4228_chunk │ 11469201408 │ 10245554176 │     7618560 │ 21722374144 │ ∅         │ f             │ 20 GB          │ 2024-05-27 00:00:00+00 │ 2024-06-01 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4227_chunk │ 10300022784 │ 10595377152 │    27140096 │ 20922540032 │ ∅         │ f             │ 19 GB          │ 2024-05-27 00:00:00+00 │ 2024-06-01 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4249_chunk │  3771916288 │  4306165760 │    35799040 │  8113881088 │ ∅         │ f             │ 7738 MB        │ 2024-05-27 00:00:00+00 │ 2024-06-01 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4250_chunk │  3980869632 │  4201881600 │     7757824 │  8190509056 │ ∅         │ f             │ 7811 MB        │ 2024-05-27 00:00:00+00 │ 2024-06-01 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4248_chunk │  4468146176 │  3999096832 │     3399680 │  8470642688 │ ∅         │ f             │ 8078 MB        │ 2024-05-27 00:00:00+00 │ 2024-06-01 00:00:00+00 │
│ _timescaledb_internal │ _hyper_109_4229_chunk │  8358584320 │  9791848448 │    67108864 │ 18217541632 │ ∅         │ f             │ 17 GB          │ 2024-05-27 00:00:00+00 │ 2024-06-01 00:00:00+00 │
└───────────────────────┴───────────────────────┴─────────────┴─────────────┴─────────────┴─────────────┴───────────┴───────────────┴────────────────┴────────────────────────┴────────────────────────┘

Dimensions:

127.0.0.1:15301 stats@stats=> select * from timescaledb_information.dimensions where hypertable_name='clicks';
┌───────────────────┬─────────────────┬──────────────────┬─────────────┬──────────────────────────┬────────────────┬───────────────┬──────────────────┬──────────────────┬────────────────┐
│ hypertable_schema │ hypertable_name │ dimension_number │ column_name │       column_type        │ dimension_type │ time_interval │ integer_interval │ integer_now_func │ num_partitions │
├───────────────────┼─────────────────┼──────────────────┼─────────────┼──────────────────────────┼────────────────┼───────────────┼──────────────────┼──────────────────┼────────────────┤
│ public            │ clicks          │                1 │ dt          │ timestamp with time zone │ Time           │ 5 days        │                ∅ │ ∅                │              ∅ │
│ public            │ clicks          │                2 │ host        │ text                     │ Space          │ ∅             │                ∅ │ ∅                │              3 │
└───────────────────┴─────────────────┴──────────────────┴─────────────┴──────────────────────────┴────────────────┴───────────────┴──────────────────┴──────────────────┴────────────────┘

TimescaleDB version affected

2.15.1

PostgreSQL version used

14.12

What operating system did you use?

(Ubuntu 14.12-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit

What installation method did you use?

Docker

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

select * from _timescaledb_catalog.chunks;
┌──────┬───────────────┬───────────────────────┬───────────────────────┬─────────────────────┬─────────┬────────┬───────────┬───────────────────────────────┐
│  id  │ hypertable_id │      schema_name      │      table_name       │ compressed_chunk_id │ dropped │ status │ osm_chunk │         creation_time         │
├──────┼───────────────┼───────────────────────┼───────────────────────┼─────────────────────┼─────────┼────────┼───────────┼───────────────────────────────┤
│ 3304 │           109 │ _timescaledb_internal │ _hyper_109_3304_chunk │                3370 │ f       │      1 │ f         │ 2024-02-16 19:48:39+00        │
│ 3568 │           109 │ _timescaledb_internal │ _hyper_109_3568_chunk │                3633 │ f       │      1 │ f         │ 2024-02-26 20:43:14+00        │
│ 4221 │           109 │ _timescaledb_internal │ _hyper_109_4221_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-22 00:00:00.073553+00 │
│ 3543 │           109 │ _timescaledb_internal │ _hyper_109_3543_chunk │                3639 │ f       │      1 │ f         │ 2024-02-27 22:01:01+00        │
│ 3636 │           109 │ _timescaledb_internal │ _hyper_109_3636_chunk │                3730 │ f       │      1 │ f         │ 2024-03-03 00:00:00.835353+00 │
│ 3637 │           109 │ _timescaledb_internal │ _hyper_109_3637_chunk │                3731 │ f       │      1 │ f         │ 2024-03-03 00:00:00.922764+00 │
│ 3672 │           109 │ _timescaledb_internal │ _hyper_109_3672_chunk │                3737 │ f       │      1 │ f         │ 2024-03-08 00:00:00.21671+00  │
│ 3673 │           109 │ _timescaledb_internal │ _hyper_109_3673_chunk │                3738 │ f       │      1 │ f         │ 2024-03-08 00:00:00.342925+00 │
│ 3674 │           109 │ _timescaledb_internal │ _hyper_109_3674_chunk │                3739 │ f       │      1 │ f         │ 2024-03-08 00:00:00.368554+00 │
│ 1794 │           109 │ _timescaledb_internal │ _hyper_109_1794_chunk │                1873 │ f       │      1 │ f         │ 2024-02-29 16:26:04+00        │
│ 1868 │           109 │ _timescaledb_internal │ _hyper_109_1868_chunk │                1971 │ f       │      1 │ f         │ 2024-02-18 18:34:33+00        │
│ 3635 │           109 │ _timescaledb_internal │ _hyper_109_3635_chunk │                3729 │ f       │      1 │ f         │ 2024-03-03 00:00:00.3358+00   │
│ 1922 │           109 │ _timescaledb_internal │ _hyper_109_1922_chunk │                2019 │ f       │      1 │ f         │ 2024-02-18 18:34:33+00        │
│ 1979 │           109 │ _timescaledb_internal │ _hyper_109_1979_chunk │                2031 │ f       │      1 │ f         │ 2024-02-18 18:34:33+00        │
│ 2024 │           109 │ _timescaledb_internal │ _hyper_109_2024_chunk │                2053 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2049 │           109 │ _timescaledb_internal │ _hyper_109_2049_chunk │                2082 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2074 │           109 │ _timescaledb_internal │ _hyper_109_2074_chunk │                2105 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2079 │           109 │ _timescaledb_internal │ _hyper_109_2079_chunk │                2159 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2086 │           109 │ _timescaledb_internal │ _hyper_109_2086_chunk │                2227 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2192 │           109 │ _timescaledb_internal │ _hyper_109_2192_chunk │                2248 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2229 │           109 │ _timescaledb_internal │ _hyper_109_2229_chunk │                2255 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2251 │           109 │ _timescaledb_internal │ _hyper_109_2251_chunk │                2277 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2257 │           109 │ _timescaledb_internal │ _hyper_109_2257_chunk │                2321 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2282 │           109 │ _timescaledb_internal │ _hyper_109_2282_chunk │                2396 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2324 │           109 │ _timescaledb_internal │ _hyper_109_2324_chunk │                2454 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2397 │           109 │ _timescaledb_internal │ _hyper_109_2397_chunk │                2456 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2431 │           109 │ _timescaledb_internal │ _hyper_109_2431_chunk │                2463 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2459 │           109 │ _timescaledb_internal │ _hyper_109_2459_chunk │                2485 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2465 │           109 │ _timescaledb_internal │ _hyper_109_2465_chunk │                2491 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2488 │           109 │ _timescaledb_internal │ _hyper_109_2488_chunk │                2515 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2496 │           109 │ _timescaledb_internal │ _hyper_109_2496_chunk │                2575 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2519 │           109 │ _timescaledb_internal │ _hyper_109_2519_chunk │                2666 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2577 │           109 │ _timescaledb_internal │ _hyper_109_2577_chunk │                2755 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2628 │           109 │ _timescaledb_internal │ _hyper_109_2628_chunk │                2777 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2757 │           109 │ _timescaledb_internal │ _hyper_109_2757_chunk │                2783 │ f       │      1 │ f         │ 2024-02-16 19:48:41+00        │
│ 2780 │           109 │ _timescaledb_internal │ _hyper_109_2780_chunk │                2837 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 2786 │           109 │ _timescaledb_internal │ _hyper_109_2786_chunk │                2909 │ f       │      1 │ f         │ 2024-02-16 19:48:41+00        │
│ 2842 │           109 │ _timescaledb_internal │ _hyper_109_2842_chunk │                3020 │ f       │      1 │ f         │ 2024-02-16 19:48:41+00        │
│ 3372 │           109 │ _timescaledb_internal │ _hyper_109_3372_chunk │                3417 │ f       │      1 │ f         │ 2024-02-27 18:45:30+00        │
│ 4222 │           109 │ _timescaledb_internal │ _hyper_109_4222_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-22 00:00:00.272034+00 │
│ 3843 │           109 │ _timescaledb_internal │ _hyper_109_3843_chunk │                3943 │ f       │      1 │ f         │ 2024-04-07 00:00:00.226955+00 │
│ 4223 │           109 │ _timescaledb_internal │ _hyper_109_4223_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-22 00:00:00.298452+00 │
│ 4227 │           109 │ _timescaledb_internal │ _hyper_109_4227_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-27 00:00:00.539648+00 │
│ 4228 │           109 │ _timescaledb_internal │ _hyper_109_4228_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-27 00:00:00.645609+00 │
│ 4229 │           109 │ _timescaledb_internal │ _hyper_109_4229_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-27 00:00:00.673005+00 │
│ 4248 │           109 │ _timescaledb_internal │ _hyper_109_4248_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-29 12:10:14.225711+00 │
│ 4249 │           109 │ _timescaledb_internal │ _hyper_109_4249_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-29 12:10:14.264537+00 │
│ 4250 │           109 │ _timescaledb_internal │ _hyper_109_4250_chunk │                   ∅ │ f       │      0 │ f         │ 2024-05-29 12:10:14.283889+00 │
│ 3735 │           109 │ _timescaledb_internal │ _hyper_109_3735_chunk │                3781 │ f       │      1 │ f         │ 2024-03-13 00:00:00.404165+00 │
│ 3736 │           109 │ _timescaledb_internal │ _hyper_109_3736_chunk │                3782 │ f       │      1 │ f         │ 2024-03-13 00:00:00.448205+00 │
│ 3740 │           109 │ _timescaledb_internal │ _hyper_109_3740_chunk │                3783 │ f       │      1 │ f         │ 2024-03-18 00:00:00.52211+00  │
│ 3741 │           109 │ _timescaledb_internal │ _hyper_109_3741_chunk │                3784 │ f       │      1 │ f         │ 2024-03-18 00:00:01.480515+00 │
│ 3742 │           109 │ _timescaledb_internal │ _hyper_109_3742_chunk │                3785 │ f       │      1 │ f         │ 2024-03-18 00:00:01.588416+00 │
│ 3760 │           109 │ _timescaledb_internal │ _hyper_109_3760_chunk │                3842 │ f       │      1 │ f         │ 2024-03-23 01:33:12.622234+00 │
│ 3734 │           109 │ _timescaledb_internal │ _hyper_109_3734_chunk │                3780 │ f       │      1 │ f         │ 2024-03-13 00:00:00.173317+00 │
│ 3844 │           109 │ _timescaledb_internal │ _hyper_109_3844_chunk │                3944 │ f       │      1 │ f         │ 2024-04-07 00:00:00.35872+00  │
│ 3845 │           109 │ _timescaledb_internal │ _hyper_109_3845_chunk │                3945 │ f       │      1 │ f         │ 2024-04-07 00:00:00.379547+00 │
│ 3761 │           109 │ _timescaledb_internal │ _hyper_109_3761_chunk │                3882 │ f       │      1 │ f         │ 2024-03-23 01:33:14.096068+00 │
│ 3762 │           109 │ _timescaledb_internal │ _hyper_109_3762_chunk │                3883 │ f       │      1 │ f         │ 2024-03-23 01:33:14.320262+00 │
│ 3786 │           109 │ _timescaledb_internal │ _hyper_109_3786_chunk │                3884 │ f       │      1 │ f         │ 2024-03-28 00:00:01.005884+00 │
│ 3787 │           109 │ _timescaledb_internal │ _hyper_109_3787_chunk │                3885 │ f       │      1 │ f         │ 2024-03-28 00:00:02.178478+00 │
│ 3788 │           109 │ _timescaledb_internal │ _hyper_109_3788_chunk │                3886 │ f       │      1 │ f         │ 2024-03-28 00:00:02.361631+00 │
│ 3809 │           109 │ _timescaledb_internal │ _hyper_109_3809_chunk │                3903 │ f       │      1 │ f         │ 2024-04-02 00:00:00.063274+00 │
│ 3810 │           109 │ _timescaledb_internal │ _hyper_109_3810_chunk │                3904 │ f       │      1 │ f         │ 2024-04-02 00:00:00.184563+00 │
│ 3811 │           109 │ _timescaledb_internal │ _hyper_109_3811_chunk │                3905 │ f       │      1 │ f         │ 2024-04-02 00:00:00.216318+00 │
│ 3946 │           109 │ _timescaledb_internal │ _hyper_109_3946_chunk │                3972 │ f       │      1 │ f         │ 2024-04-17 00:00:00.43772+00  │
│ 3947 │           109 │ _timescaledb_internal │ _hyper_109_3947_chunk │                3973 │ f       │      1 │ f         │ 2024-04-17 00:00:00.564779+00 │
│ 3948 │           109 │ _timescaledb_internal │ _hyper_109_3948_chunk │                3974 │ f       │      1 │ f         │ 2024-04-17 00:00:00.590532+00 │
│ 3911 │           109 │ _timescaledb_internal │ _hyper_109_3911_chunk │                3967 │ f       │      1 │ f         │ 2024-04-12 00:00:00.31753+00  │
│ 3912 │           109 │ _timescaledb_internal │ _hyper_109_3912_chunk │                3968 │ f       │      1 │ f         │ 2024-04-12 00:00:00.343161+00 │
│ 3910 │           109 │ _timescaledb_internal │ _hyper_109_3910_chunk │                3966 │ f       │      1 │ f         │ 2024-04-12 00:00:00.066582+00 │
│ 3969 │           109 │ _timescaledb_internal │ _hyper_109_3969_chunk │                4062 │ f       │      1 │ f         │ 2024-04-22 00:00:00.146066+00 │
│ 3970 │           109 │ _timescaledb_internal │ _hyper_109_3970_chunk │                4063 │ f       │      1 │ f         │ 2024-04-22 00:00:00.300841+00 │
│ 3971 │           109 │ _timescaledb_internal │ _hyper_109_3971_chunk │                4064 │ f       │      1 │ f         │ 2024-04-22 00:00:00.323696+00 │
│ 3976 │           109 │ _timescaledb_internal │ _hyper_109_3976_chunk │                4101 │ f       │      1 │ f         │ 2024-04-27 00:00:00.18157+00  │
│ 3977 │           109 │ _timescaledb_internal │ _hyper_109_3977_chunk │                4102 │ f       │      1 │ f         │ 2024-04-27 00:00:00.202503+00 │
│ 4098 │           109 │ _timescaledb_internal │ _hyper_109_4098_chunk │                4156 │ f       │      1 │ f         │ 2024-05-02 00:00:00.530011+00 │
│ 4099 │           109 │ _timescaledb_internal │ _hyper_109_4099_chunk │                4157 │ f       │      1 │ f         │ 2024-05-02 00:00:00.553303+00 │
│ 3975 │           109 │ _timescaledb_internal │ _hyper_109_3975_chunk │                4100 │ f       │      1 │ f         │ 2024-04-27 00:00:00.098314+00 │
│ 4097 │           109 │ _timescaledb_internal │ _hyper_109_4097_chunk │                4155 │ f       │      1 │ f         │ 2024-05-02 00:00:00.403928+00 │
│ 4181 │           109 │ _timescaledb_internal │ _hyper_109_4181_chunk │                4224 │ f       │      1 │ f         │ 2024-05-17 00:00:00.448404+00 │
│ 4103 │           109 │ _timescaledb_internal │ _hyper_109_4103_chunk │                4178 │ f       │      1 │ f         │ 2024-05-07 00:00:00.310949+00 │
│ 4104 │           109 │ _timescaledb_internal │ _hyper_109_4104_chunk │                4179 │ f       │      1 │ f         │ 2024-05-07 00:00:00.447471+00 │
│ 4105 │           109 │ _timescaledb_internal │ _hyper_109_4105_chunk │                4180 │ f       │      1 │ f         │ 2024-05-07 00:00:00.469646+00 │
│ 4158 │           109 │ _timescaledb_internal │ _hyper_109_4158_chunk │                4218 │ f       │      1 │ f         │ 2024-05-12 00:00:00.125514+00 │
│ 4159 │           109 │ _timescaledb_internal │ _hyper_109_4159_chunk │                4219 │ f       │      1 │ f         │ 2024-05-12 00:00:00.185657+00 │
│ 4160 │           109 │ _timescaledb_internal │ _hyper_109_4160_chunk │                4220 │ f       │      1 │ f         │ 2024-05-12 00:00:00.209566+00 │
│ 4182 │           109 │ _timescaledb_internal │ _hyper_109_4182_chunk │                4225 │ f       │      1 │ f         │ 2024-05-17 00:00:00.640669+00 │
│ 4183 │           109 │ _timescaledb_internal │ _hyper_109_4183_chunk │                4226 │ f       │      1 │ f         │ 2024-05-17 00:00:00.663987+00 │
│ 1710 │           109 │ _timescaledb_internal │ _hyper_109_1710_chunk │                1796 │ f       │      1 │ f         │ 2024-01-24 05:08:48+00        │
│ 1711 │           109 │ _timescaledb_internal │ _hyper_109_1711_chunk │                1797 │ f       │      1 │ f         │ 2024-02-15 13:58:28+00        │
│ 1712 │           109 │ _timescaledb_internal │ _hyper_109_1712_chunk │                1798 │ f       │      1 │ f         │ 2024-02-29 16:26:04+00        │
│ 1793 │           109 │ _timescaledb_internal │ _hyper_109_1793_chunk │                1872 │ f       │      1 │ f         │ 2024-02-15 13:58:29+00        │
│ 1795 │           109 │ _timescaledb_internal │ _hyper_109_1795_chunk │                1874 │ f       │      1 │ f         │ 2023-11-01 09:45:57+00        │
│ 1869 │           109 │ _timescaledb_internal │ _hyper_109_1869_chunk │                1972 │ f       │      1 │ f         │ 2024-01-25 16:09:24+00        │
│ 1870 │           109 │ _timescaledb_internal │ _hyper_109_1870_chunk │                1973 │ f       │      1 │ f         │ 2024-02-15 13:58:32+00        │
│ 1921 │           109 │ _timescaledb_internal │ _hyper_109_1921_chunk │                2029 │ f       │      1 │ f         │ 2024-02-15 13:58:33+00        │
│ 1923 │           109 │ _timescaledb_internal │ _hyper_109_1923_chunk │                2020 │ f       │      1 │ f         │ 2023-11-01 12:14:34+00        │
│ 1978 │           109 │ _timescaledb_internal │ _hyper_109_1978_chunk │                2030 │ f       │      1 │ f         │ 2024-02-15 13:58:36+00        │
│ 1980 │           109 │ _timescaledb_internal │ _hyper_109_1980_chunk │                2025 │ f       │      1 │ f         │ 2023-11-01 10:13:52+00        │
│ 2022 │           109 │ _timescaledb_internal │ _hyper_109_2022_chunk │                2052 │ f       │      1 │ f         │ 2024-02-17 22:02:30+00        │
│ 2023 │           109 │ _timescaledb_internal │ _hyper_109_2023_chunk │                2054 │ f       │      1 │ f         │ 2023-11-01 11:48:19+00        │
│ 2050 │           109 │ _timescaledb_internal │ _hyper_109_2050_chunk │                2080 │ f       │      1 │ f         │ 2023-11-01 09:27:34+00        │
│ 2051 │           109 │ _timescaledb_internal │ _hyper_109_2051_chunk │                2083 │ f       │      1 │ f         │ 2023-11-01 10:08:25+00        │
│ 2075 │           109 │ _timescaledb_internal │ _hyper_109_2075_chunk │                2081 │ f       │      1 │ f         │ 2023-11-01 12:05:57+00        │
│ 2076 │           109 │ _timescaledb_internal │ _hyper_109_2076_chunk │                2104 │ f       │      1 │ f         │ 2023-11-01 13:22:23+00        │
│ 2077 │           109 │ _timescaledb_internal │ _hyper_109_2077_chunk │                2157 │ f       │      1 │ f         │ 2023-11-01 13:06:40+00        │
│ 2078 │           109 │ _timescaledb_internal │ _hyper_109_2078_chunk │                2158 │ f       │      1 │ f         │ 2023-11-01 11:05:21+00        │
│ 2084 │           109 │ _timescaledb_internal │ _hyper_109_2084_chunk │                2225 │ f       │      1 │ f         │ 2023-11-01 12:42:20+00        │
│ 2085 │           109 │ _timescaledb_internal │ _hyper_109_2085_chunk │                2226 │ f       │      1 │ f         │ 2023-11-01 11:48:37+00        │
│ 2193 │           109 │ _timescaledb_internal │ _hyper_109_2193_chunk │                2249 │ f       │      1 │ f         │ 2023-11-01 10:46:28+00        │
│ 2194 │           109 │ _timescaledb_internal │ _hyper_109_2194_chunk │                2250 │ f       │      1 │ f         │ 2023-11-01 12:02:07+00        │
│ 2228 │           109 │ _timescaledb_internal │ _hyper_109_2228_chunk │                2254 │ f       │      1 │ f         │ 2023-11-01 10:45:57+00        │
│ 2230 │           109 │ _timescaledb_internal │ _hyper_109_2230_chunk │                2256 │ f       │      1 │ f         │ 2023-11-01 11:05:03+00        │
│ 2252 │           109 │ _timescaledb_internal │ _hyper_109_2252_chunk │                2278 │ f       │      1 │ f         │ 2023-11-01 14:03:20+00        │
│ 2253 │           109 │ _timescaledb_internal │ _hyper_109_2253_chunk │                2279 │ f       │      1 │ f         │ 2023-11-01 14:16:15+00        │
│ 2258 │           109 │ _timescaledb_internal │ _hyper_109_2258_chunk │                2320 │ f       │      1 │ f         │ 2023-11-01 13:53:26+00        │
│ 2259 │           109 │ _timescaledb_internal │ _hyper_109_2259_chunk │                2331 │ f       │      1 │ f         │ 2023-11-01 11:42:09+00        │
│ 2280 │           109 │ _timescaledb_internal │ _hyper_109_2280_chunk │                2394 │ f       │      1 │ f         │ 2023-11-01 12:31:36+00        │
│ 2281 │           109 │ _timescaledb_internal │ _hyper_109_2281_chunk │                2395 │ f       │      1 │ f         │ 2023-11-01 12:44:33+00        │
│ 2322 │           109 │ _timescaledb_internal │ _hyper_109_2322_chunk │                2452 │ f       │      1 │ f         │ 2023-11-01 11:36:59+00        │
│ 2323 │           109 │ _timescaledb_internal │ _hyper_109_2323_chunk │                2453 │ f       │      1 │ f         │ 2023-11-01 09:36:52+00        │
│ 2398 │           109 │ _timescaledb_internal │ _hyper_109_2398_chunk │                2457 │ f       │      1 │ f         │ 2023-11-01 13:13:24+00        │
│ 2399 │           109 │ _timescaledb_internal │ _hyper_109_2399_chunk │                2458 │ f       │      1 │ f         │ 2023-11-01 10:33:28+00        │
│ 2430 │           109 │ _timescaledb_internal │ _hyper_109_2430_chunk │                2462 │ f       │      1 │ f         │ 2023-11-01 11:33:59+00        │
│ 2432 │           109 │ _timescaledb_internal │ _hyper_109_2432_chunk │                2464 │ f       │      1 │ f         │ 2023-11-01 09:35:13+00        │
│ 2460 │           109 │ _timescaledb_internal │ _hyper_109_2460_chunk │                2486 │ f       │      1 │ f         │ 2023-11-01 09:49:57+00        │
│ 2461 │           109 │ _timescaledb_internal │ _hyper_109_2461_chunk │                2487 │ f       │      1 │ f         │ 2023-11-01 12:54:03+00        │
│ 2466 │           109 │ _timescaledb_internal │ _hyper_109_2466_chunk │                2492 │ f       │      1 │ f         │ 2023-11-01 12:19:44+00        │
│ 2467 │           109 │ _timescaledb_internal │ _hyper_109_2467_chunk │                2493 │ f       │      1 │ f         │ 2023-11-01 13:12:01+00        │
│ 2489 │           109 │ _timescaledb_internal │ _hyper_109_2489_chunk │                2516 │ f       │      1 │ f         │ 2023-11-01 14:08:35+00        │
│ 2490 │           109 │ _timescaledb_internal │ _hyper_109_2490_chunk │                2517 │ f       │      1 │ f         │ 2023-11-01 12:58:49+00        │
│ 2494 │           109 │ _timescaledb_internal │ _hyper_109_2494_chunk │                2573 │ f       │      1 │ f         │ 2023-11-01 13:38:08+00        │
│ 2495 │           109 │ _timescaledb_internal │ _hyper_109_2495_chunk │                2574 │ f       │      1 │ f         │ 2023-11-01 11:03:45+00        │
│ 2518 │           109 │ _timescaledb_internal │ _hyper_109_2518_chunk │                2631 │ f       │      1 │ f         │ 2023-11-01 14:03:20+00        │
│ 2520 │           109 │ _timescaledb_internal │ _hyper_109_2520_chunk │                2667 │ f       │      1 │ f         │ 2023-11-01 12:30:03+00        │
│ 2576 │           109 │ _timescaledb_internal │ _hyper_109_2576_chunk │                2754 │ f       │      1 │ f         │ 2023-11-01 12:11:56+00        │
│ 2578 │           109 │ _timescaledb_internal │ _hyper_109_2578_chunk │                2756 │ f       │      1 │ f         │ 2023-11-01 10:35:06+00        │
│ 2629 │           109 │ _timescaledb_internal │ _hyper_109_2629_chunk │                2778 │ f       │      1 │ f         │ 2023-11-01 11:04:18+00        │
│ 2630 │           109 │ _timescaledb_internal │ _hyper_109_2630_chunk │                2779 │ f       │      1 │ f         │ 2023-11-01 10:48:47+00        │
│ 2758 │           109 │ _timescaledb_internal │ _hyper_109_2758_chunk │                2784 │ f       │      1 │ f         │ 2023-11-04 13:07:21+00        │
│ 2759 │           109 │ _timescaledb_internal │ _hyper_109_2759_chunk │                2785 │ f       │      1 │ f         │ 2023-11-04 13:07:43+00        │
│ 2781 │           109 │ _timescaledb_internal │ _hyper_109_2781_chunk │                2838 │ f       │      1 │ f         │ 2023-11-09 13:22:57+00        │
│ 2782 │           109 │ _timescaledb_internal │ _hyper_109_2782_chunk │                2839 │ f       │      1 │ f         │ 2023-11-09 13:23:19+00        │
│ 2787 │           109 │ _timescaledb_internal │ _hyper_109_2787_chunk │                2910 │ f       │      1 │ f         │ 2023-11-14 13:07:21+00        │
│ 2788 │           109 │ _timescaledb_internal │ _hyper_109_2788_chunk │                2911 │ f       │      1 │ f         │ 2023-11-14 13:07:41+00        │
│ 2840 │           109 │ _timescaledb_internal │ _hyper_109_2840_chunk │                3015 │ f       │      1 │ f         │ 2023-11-19 13:21:50+00        │
│ 2841 │           109 │ _timescaledb_internal │ _hyper_109_2841_chunk │                3019 │ f       │      1 │ f         │ 2023-11-19 13:22:28+00        │
│ 2912 │           109 │ _timescaledb_internal │ _hyper_109_2912_chunk │                3043 │ f       │      1 │ f         │ 2023-11-24 13:07:02+00        │
│ 2913 │           109 │ _timescaledb_internal │ _hyper_109_2913_chunk │                3044 │ f       │      1 │ f         │ 2024-02-16 19:48:41+00        │
│ 2914 │           109 │ _timescaledb_internal │ _hyper_109_2914_chunk │                3045 │ f       │      1 │ f         │ 2023-11-24 13:08:19+00        │
│ 3016 │           109 │ _timescaledb_internal │ _hyper_109_3016_chunk │                3047 │ f       │      1 │ f         │ 2023-11-29 13:35:22+00        │
│ 3017 │           109 │ _timescaledb_internal │ _hyper_109_3017_chunk │                3048 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3018 │           109 │ _timescaledb_internal │ _hyper_109_3018_chunk │                3049 │ f       │      1 │ f         │ 2023-11-29 13:36:04+00        │
│ 3021 │           109 │ _timescaledb_internal │ _hyper_109_3021_chunk │                3053 │ f       │      1 │ f         │ 2023-12-04 13:07:02+00        │
│ 3022 │           109 │ _timescaledb_internal │ _hyper_109_3022_chunk │                3054 │ f       │      1 │ f         │ 2023-12-04 13:07:13+00        │
│ 3023 │           109 │ _timescaledb_internal │ _hyper_109_3023_chunk │                3055 │ f       │      1 │ f         │ 2024-02-16 19:48:41+00        │
│ 3050 │           109 │ _timescaledb_internal │ _hyper_109_3050_chunk │                3108 │ f       │      1 │ f         │ 2023-12-09 13:27:01+00        │
│ 3051 │           109 │ _timescaledb_internal │ _hyper_109_3051_chunk │                3109 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3052 │           109 │ _timescaledb_internal │ _hyper_109_3052_chunk │                3115 │ f       │      1 │ f         │ 2023-12-09 13:28:03+00        │
│ 3056 │           109 │ _timescaledb_internal │ _hyper_109_3056_chunk │                3163 │ f       │      1 │ f         │ 2023-12-14 13:07:02+00        │
│ 3057 │           109 │ _timescaledb_internal │ _hyper_109_3057_chunk │                3172 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3058 │           109 │ _timescaledb_internal │ _hyper_109_3058_chunk │                3173 │ f       │      1 │ f         │ 2023-12-14 13:07:48+00        │
│ 3111 │           109 │ _timescaledb_internal │ _hyper_109_3111_chunk │                3206 │ f       │      1 │ f         │ 2023-12-19 13:26:33+00        │
│ 3112 │           109 │ _timescaledb_internal │ _hyper_109_3112_chunk │                3207 │ f       │      1 │ f         │ 2024-02-16 19:48:41+00        │
│ 3113 │           109 │ _timescaledb_internal │ _hyper_109_3113_chunk │                3208 │ f       │      1 │ f         │ 2023-12-19 13:27:45+00        │
│ 3127 │           109 │ _timescaledb_internal │ _hyper_109_3127_chunk │                3212 │ f       │      1 │ f         │ 2023-12-24 13:07:02+00        │
│ 3128 │           109 │ _timescaledb_internal │ _hyper_109_3128_chunk │                3213 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3129 │           109 │ _timescaledb_internal │ _hyper_109_3129_chunk │                3214 │ f       │      1 │ f         │ 2023-12-24 13:07:50+00        │
│ 3209 │           109 │ _timescaledb_internal │ _hyper_109_3209_chunk │                3235 │ f       │      1 │ f         │ 2023-12-29 13:28:09+00        │
│ 3210 │           109 │ _timescaledb_internal │ _hyper_109_3210_chunk │                3236 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3211 │           109 │ _timescaledb_internal │ _hyper_109_3211_chunk │                3237 │ f       │      1 │ f         │ 2023-12-29 13:29:28+00        │
│ 3215 │           109 │ _timescaledb_internal │ _hyper_109_3215_chunk │                3274 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3216 │           109 │ _timescaledb_internal │ _hyper_109_3216_chunk │                3275 │ f       │      1 │ f         │ 2024-01-03 13:09:28+00        │
│ 3217 │           109 │ _timescaledb_internal │ _hyper_109_3217_chunk │                3276 │ f       │      1 │ f         │ 2024-01-03 13:09:54+00        │
│ 3238 │           109 │ _timescaledb_internal │ _hyper_109_3238_chunk │                3296 │ f       │      1 │ f         │ 2024-02-16 19:48:39+00        │
│ 3239 │           109 │ _timescaledb_internal │ _hyper_109_3239_chunk │                3297 │ f       │      1 │ f         │ 2024-01-08 13:27:55+00        │
│ 3240 │           109 │ _timescaledb_internal │ _hyper_109_3240_chunk │                3298 │ f       │      1 │ f         │ 2024-01-08 13:28:22+00        │
│ 3277 │           109 │ _timescaledb_internal │ _hyper_109_3277_chunk │                3308 │ f       │      1 │ f         │ 2024-01-13 13:07:02+00        │
│ 3278 │           109 │ _timescaledb_internal │ _hyper_109_3278_chunk │                3326 │ f       │      1 │ f         │ 2024-02-16 19:48:39+00        │
│ 3279 │           109 │ _timescaledb_internal │ _hyper_109_3279_chunk │                3327 │ f       │      1 │ f         │ 2024-01-13 13:08:06+00        │
│ 3299 │           109 │ _timescaledb_internal │ _hyper_109_3299_chunk │                3328 │ f       │      1 │ f         │ 2024-01-18 13:32:53+00        │
│ 3300 │           109 │ _timescaledb_internal │ _hyper_109_3300_chunk │                3329 │ f       │      1 │ f         │ 2024-02-16 19:48:39+00        │
│ 3301 │           109 │ _timescaledb_internal │ _hyper_109_3301_chunk │                3330 │ f       │      1 │ f         │ 2024-01-18 13:34:43+00        │
│ 3302 │           109 │ _timescaledb_internal │ _hyper_109_3302_chunk │                3391 │ f       │      1 │ f         │ 2024-02-29 13:03:44+00        │
│ 3303 │           109 │ _timescaledb_internal │ _hyper_109_3303_chunk │                3367 │ f       │      1 │ f         │ 2024-01-23 13:07:30+00        │
│ 3331 │           109 │ _timescaledb_internal │ _hyper_109_3331_chunk │                3410 │ f       │      1 │ f         │ 2024-01-28 13:41:29+00        │
│ 3332 │           109 │ _timescaledb_internal │ _hyper_109_3332_chunk │                3411 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3333 │           109 │ _timescaledb_internal │ _hyper_109_3333_chunk │                3412 │ f       │      1 │ f         │ 2024-02-27 18:47:41+00        │
│ 3371 │           109 │ _timescaledb_internal │ _hyper_109_3371_chunk │                3416 │ f       │      1 │ f         │ 2024-02-16 19:48:40+00        │
│ 3373 │           109 │ _timescaledb_internal │ _hyper_109_3373_chunk │                3418 │ f       │      1 │ f         │ 2024-02-02 13:08:34+00        │
│ 3414 │           109 │ _timescaledb_internal │ _hyper_109_3414_chunk │                3442 │ f       │      1 │ f         │ 2024-02-16 19:48:39+00        │
│ 3415 │           109 │ _timescaledb_internal │ _hyper_109_3415_chunk │                3443 │ f       │      1 │ f         │ 2024-02-07 13:43:33+00        │
│ 3419 │           109 │ _timescaledb_internal │ _hyper_109_3419_chunk │                3449 │ f       │      1 │ f         │ 2024-02-12 13:07:02+00        │
│ 3420 │           109 │ _timescaledb_internal │ _hyper_109_3420_chunk │                3450 │ f       │      1 │ f         │ 2024-02-27 18:45:09+00        │
│ 3421 │           109 │ _timescaledb_internal │ _hyper_109_3421_chunk │                3451 │ f       │      1 │ f         │ 2024-02-16 19:48:39+00        │
│ 3444 │           109 │ _timescaledb_internal │ _hyper_109_3444_chunk │                3507 │ f       │      1 │ f         │ 2024-02-17 13:29:54+00        │
│ 3445 │           109 │ _timescaledb_internal │ _hyper_109_3445_chunk │                3508 │ f       │      1 │ f         │ 2024-02-27 17:35:18+00        │
│ 3446 │           109 │ _timescaledb_internal │ _hyper_109_3446_chunk │                3509 │ f       │      1 │ f         │ 2024-02-17 13:31:52+00        │
│ 3452 │           109 │ _timescaledb_internal │ _hyper_109_3452_chunk │                3510 │ f       │      1 │ f         │ 2024-02-22 13:07:03+00        │
│ 3453 │           109 │ _timescaledb_internal │ _hyper_109_3453_chunk │                3511 │ f       │      1 │ f         │ 2024-02-27 17:35:23+00        │
│ 3454 │           109 │ _timescaledb_internal │ _hyper_109_3454_chunk │                3512 │ f       │      1 │ f         │ 2024-02-22 14:50:52+00        │
│ 3487 │           109 │ _timescaledb_internal │ _hyper_109_3487_chunk │                3532 │ f       │      1 │ f         │ 2024-02-27 13:36:47+00        │
│ 3488 │           109 │ _timescaledb_internal │ _hyper_109_3488_chunk │                3533 │ f       │      1 │ f         │ 2024-02-27 17:35:23+00        │
│ 3489 │           109 │ _timescaledb_internal │ _hyper_109_3489_chunk │                3534 │ f       │      1 │ f         │ 2024-02-27 13:38:51+00        │
│ 3513 │           109 │ _timescaledb_internal │ _hyper_109_3513_chunk │                3538 │ f       │      1 │ f         │ 2024-02-27 17:35:23+00        │
│ 3514 │           109 │ _timescaledb_internal │ _hyper_109_3514_chunk │                3539 │ f       │      1 │ f         │ 2024-02-16 19:48:35+00        │
│ 3515 │           109 │ _timescaledb_internal │ _hyper_109_3515_chunk │                3541 │ f       │      1 │ f         │ 2024-02-17 01:00:48+00        │
│ 3535 │           109 │ _timescaledb_internal │ _hyper_109_3535_chunk │                3606 │ f       │      1 │ f         │ 2024-02-24 08:32:15+00        │
│ 3536 │           109 │ _timescaledb_internal │ _hyper_109_3536_chunk │                3607 │ f       │      1 │ f         │ 2024-02-27 17:35:18+00        │
│ 3537 │           109 │ _timescaledb_internal │ _hyper_109_3537_chunk │                3608 │ f       │      1 │ f         │ 2024-02-24 18:25:28+00        │
│ 3542 │           109 │ _timescaledb_internal │ _hyper_109_3542_chunk │                3733 │ f       │      1 │ f         │ 2024-02-27 22:06:09+00        │
│ 3544 │           109 │ _timescaledb_internal │ _hyper_109_3544_chunk │                3732 │ f       │      1 │ f         │ 2024-02-27 21:31:45+00        │
│ 3413 │           109 │ _timescaledb_internal │ _hyper_109_3413_chunk │                3909 │ f       │      1 │ f         │ 2024-02-27 18:44:24+00        │
│ 3569 │           109 │ _timescaledb_internal │ _hyper_109_3569_chunk │                3634 │ f       │      1 │ f         │ 2024-02-28 17:13:23+00        │
│ 3570 │           109 │ _timescaledb_internal │ _hyper_109_3570_chunk │                3638 │ f       │      1 │ f         │ 2024-02-29 16:25:24+00        │
│ 3613 │           109 │ _timescaledb_internal │ _hyper_109_3613_chunk │                3709 │ f       │      1 │ f         │ 2024-02-29 16:26:01+00        │
│ 3614 │           109 │ _timescaledb_internal │ _hyper_109_3614_chunk │                3710 │ f       │      1 │ f         │ 2024-02-29 14:43:59+00        │
│ 3615 │           109 │ _timescaledb_internal │ _hyper_109_3615_chunk │                3711 │ f       │      1 │ f         │ 2024-02-29 08:04:28+00        │
└──────┴───────────────┴───────────────────────┴───────────────────────┴─────────────────────┴─────────┴────────┴───────────┴───────────────────────────────┘
(219 rows)

How can we reproduce the bug?

1. Create table with partitioning by hash and date on tsdb 2.14
2. insert some data
3. upgrade to tsdb 2.15

I'm not sure it will work 100%, but I can provide any additional data from my configuration
@gugu gugu added the bug label May 30, 2024
@gugu gugu changed the title [Bug]: <Title> [Bug]: Upgrade to tsdb 2.15.1 caused selects by partitioned column to return only data after upgrade May 30, 2024
@gugu
Copy link
Author

gugu commented May 30, 2024

If I try to trick optimizer it works, but does not use index in compressed rows

> explain select count(*) from clicks where host='REDACTED' || substring(now()::text, 1, 0) and dt > now() - interval '10 days';
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                      QUERY PLAN                                                                                                      │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Finalize Aggregate  (cost=378713.81..378713.82 rows=1 width=8)                                                                                                                                                       │
│   ->  Gather  (cost=1000.59..378713.75 rows=24 width=8)                                                                                                                                                              │
│         Workers Planned: 2                                                                                                                                                                                           │
│         ->  Parallel Custom Scan (ChunkAppend) on clicks  (cost=0.58..377711.35 rows=12 width=8)                                                                                                                     │
│               Chunks excluded during startup: 0                                                                                                                                                                      │
│               ->  Partial Aggregate  (cost=732.70..732.71 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4222_chunk_clicks_host_dt_idx on _hyper_109_4222_chunk  (cost=0.58..725.09 rows=3044 width=0)                                                      │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=407.08..407.09 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4223_chunk_clicks_host_dt_idx on _hyper_109_4223_chunk  (cost=0.58..400.09 rows=2794 width=0)                                                      │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=1006.61..1006.62 rows=1 width=8)                                                                                                                                          │
│                     ->  Parallel Index Only Scan using _hyper_109_4221_chunk_clicks_host_dt_idx on _hyper_109_4221_chunk  (cost=0.58..999.88 rows=2692 width=0)                                                      │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=298.59..298.60 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4228_chunk_clicks_host_dt_idx on _hyper_109_4228_chunk  (cost=0.58..294.92 rows=1470 width=0)                                                      │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=270.00..270.01 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4227_chunk_clicks_host_dt_idx on _hyper_109_4227_chunk  (cost=0.58..266.36 rows=1458 width=0)                                                      │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=122.08..122.09 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4229_chunk_clicks_host_dt_idx on _hyper_109_4229_chunk  (cost=0.58..118.54 rows=1419 width=0)                                                      │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=166.91..166.92 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4250_chunk_clicks_host_dt_idx on _hyper_109_4250_chunk  (cost=0.58..165.26 rows=659 width=0)                                                       │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=104.95..104.96 rows=1 width=8)                                                                                                                                            │
│                     ->  Parallel Index Only Scan using _hyper_109_4249_chunk_clicks_host_dt_idx on _hyper_109_4249_chunk  (cost=0.58..103.07 rows=753 width=0)                                                       │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=35.35..35.36 rows=1 width=8)                                                                                                                                              │
│                     ->  Parallel Index Only Scan using _hyper_109_4248_chunk_clicks_host_dt_idx on _hyper_109_4248_chunk  (cost=0.58..33.67 rows=672 width=0)                                                        │
│                           Index Cond: ((host = ('REDACTED'::text || "substring"((now())::text, 1, 0))) AND (dt > (now() - '10 days'::interval)) AND (dt > '2024-05-20 09:56:51.80338+00'::timestamp with time zone)) │
│               ->  Partial Aggregate  (cost=111799.42..111799.43 rows=1 width=8)                                                                                                                                      │
│                     ->  Custom Scan (DecompressChunk) on _hyper_109_4181_chunk  (cost=0.21..8694.42 rows=41242000 width=0)                                                                                           │
│                           Filter: (host = ('REDACTED'::text || "substring"((now())::text, 1, 0)))                                                                                                                    │
│                           Vectorized Filter: (dt > (now() - '10 days'::interval))                                                                                                                                    │
│                           ->  Parallel Seq Scan on compress_hyper_110_4224_chunk  (cost=0.00..8694.42 rows=41242 width=68)                                                                                           │
│               ->  Partial Aggregate  (cost=131155.58..131155.59 rows=1 width=8)                                                                                                                                      │
│                     ->  Custom Scan (DecompressChunk) on _hyper_109_4183_chunk  (cost=0.20..9760.58 rows=48558000 width=0)                                                                                           │
│                           Filter: (host = ('REDACTED'::text || "substring"((now())::text, 1, 0)))                                                                                                                    │
│                           Vectorized Filter: (dt > (now() - '10 days'::interval))                                                                                                                                    │
│                           ->  Parallel Seq Scan on compress_hyper_110_4226_chunk  (cost=0.00..9760.58 rows=48558 width=68)                                                                                           │
│               ->  Partial Aggregate  (cost=131611.95..131611.96 rows=1 width=8)                                                                                                                                      │
│                     ->  Custom Scan (DecompressChunk) on _hyper_109_4182_chunk  (cost=0.20..9749.45 rows=48745000 width=0)                                                                                           │
│                           Filter: (host = ('REDACTED'::text || "substring"((now())::text, 1, 0)))                                                                                                                    │
│                           Vectorized Filter: (dt > (now() - '10 days'::interval))                                                                                                                                    │
│                           ->  Parallel Seq Scan on compress_hyper_110_4225_chunk  (cost=0.00..9749.45 rows=48745 width=67)                                                                                           │
│ JIT:                                                                                                                                                                                                                 │
│   Functions: 50                                                                                                                                                                                                      │
│   Options: Inlining false, Optimization false, Expressions true, Deforming true                                                                                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

@gugu
Copy link
Author

gugu commented May 30, 2024

This is a workaround:

127.0.0.1:12034 stats@stats=> explain select count(*) from clicks where host='REDACTED' || (select substring(now()::text, 1, 0)) and dt > now() - interval '11 days';
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                QUERY PLAN                                                                                 │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Finalize Aggregate  (cost=16117.04..16117.05 rows=1 width=8)                                                                                                              │
│   InitPlan 1 (returns $0)                                                                                                                                                 │
│     ->  Result  (cost=0.00..0.02 rows=1 width=32)                                                                                                                         │
│   ->  Custom Scan (ChunkAppend) on clicks  (cost=1.57..16116.99 rows=12 width=8)                                                                                          │
│         Chunks excluded during startup: 0                                                                                                                                 │
│         ->  Partial Aggregate  (cost=8.14..8.15 rows=1 width=8)                                                                                                           │
│               ->  Custom Scan (DecompressChunk) on _hyper_109_4181_chunk  (cost=1.57..3.14 rows=2000 width=0)                                                             │
│                     Vectorized Filter: (dt > (now() - '11 days'::interval))                                                                                               │
│                     ->  Index Scan using compress_hyper_110_4224_chunk_host__ts_meta_sequence_num_idx on compress_hyper_110_4224_chunk  (cost=0.42..3.14 rows=2 width=68) │
│                           Index Cond: (host = ('REDACTED'::text || $0))                                                                                                   │
│         ->  Partial Aggregate  (cost=11.14..11.15 rows=1 width=8)                                                                                                         │
│               ->  Custom Scan (DecompressChunk) on _hyper_109_4182_chunk  (cost=1.21..3.64 rows=3000 width=0)                                                             │
│                     Vectorized Filter: (dt > (now() - '11 days'::interval))                                                                                               │
│                     ->  Index Scan using compress_hyper_110_4225_chunk_host__ts_meta_sequence_num_idx on compress_hyper_110_4225_chunk  (cost=0.42..3.64 rows=3 width=67) │
│                           Index Cond: (host = ('REDACTED'::text || $0))                                                                                                   │
│         ->  Partial Aggregate  (cost=11.14..11.15 rows=1 width=8)                                                                                                         │
│               ->  Custom Scan (DecompressChunk) on _hyper_109_4183_chunk  (cost=1.21..3.64 rows=3000 width=0)                                                             │
│                     Vectorized Filter: (dt > (now() - '11 days'::interval))                                                                                               │
│                     ->  Index Scan using compress_hyper_110_4226_chunk_host__ts_meta_sequence_num_idx on compress_hyper_110_4226_chunk  (cost=0.42..3.64 rows=3 width=68) │
│                           Index Cond: (host = ('REDACTED'::text || $0))                                                                                                   │
│         ->  Partial Aggregate  (cost=5004.00..5004.01 rows=1 width=8)                                                                                                     │
│               ->  Index Only Scan using _hyper_109_4221_chunk_clicks_host_dt_idx on _hyper_109_4221_chunk  (cost=0.57..4948.15 rows=22340 width=0)                        │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=3606.33..3606.34 rows=1 width=8)                                                                                                     │
│               ->  Index Only Scan using _hyper_109_4222_chunk_clicks_host_dt_idx on _hyper_109_4222_chunk  (cost=0.57..3544.62 rows=24682 width=0)                        │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=2165.40..2165.41 rows=1 width=8)                                                                                                     │
│               ->  Index Only Scan using _hyper_109_4223_chunk_clicks_host_dt_idx on _hyper_109_4223_chunk  (cost=0.57..2105.58 rows=23931 width=0)                        │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=1423.30..1423.31 rows=1 width=8)                                                                                                     │
│               ->  Index Only Scan using _hyper_109_4227_chunk_clicks_host_dt_idx on _hyper_109_4227_chunk  (cost=0.57..1391.91 rows=12558 width=0)                        │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=1594.16..1594.17 rows=1 width=8)                                                                                                     │
│               ->  Index Only Scan using _hyper_109_4228_chunk_clicks_host_dt_idx on _hyper_109_4228_chunk  (cost=0.57..1562.05 rows=12846 width=0)                        │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=567.60..567.61 rows=1 width=8)                                                                                                       │
│               ->  Index Only Scan using _hyper_109_4229_chunk_clicks_host_dt_idx on _hyper_109_4229_chunk  (cost=0.57..541.65 rows=10378 width=0)                         │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=280.81..280.82 rows=1 width=8)                                                                                                       │
│               ->  Index Only Scan using _hyper_109_4248_chunk_clicks_host_dt_idx on _hyper_109_4248_chunk  (cost=0.57..266.04 rows=5906 width=0)                          │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=552.80..552.81 rows=1 width=8)                                                                                                       │
│               ->  Index Only Scan using _hyper_109_4249_chunk_clicks_host_dt_idx on _hyper_109_4249_chunk  (cost=0.57..538.23 rows=5828 width=0)                          │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
│         ->  Partial Aggregate  (cost=892.06..892.07 rows=1 width=8)                                                                                                       │
│               ->  Index Only Scan using _hyper_109_4250_chunk_clicks_host_dt_idx on _hyper_109_4250_chunk  (cost=0.57..878.01 rows=5619 width=0)                          │
│                     Index Cond: ((host = ('REDACTED'::text || $0)) AND (dt > (now() - '11 days'::interval)))                                                              │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(47 rows)

@antekresic
Copy link
Contributor

Hi there,

Do you get different query results using your workaround and without it? Just asking because its not clear that you are just by looking at query plans.

Space partitioning on host should in theory reduce the amount of chunks you need to query based on the partitioning column filter (host in your case).

Can you confirm this?

Thanks!

@gugu
Copy link
Author

gugu commented Jun 3, 2024

Yes. Query without workaround returns only data after the timescale upgrade happened. The query without workaround returns all matched data

@antekresic
Copy link
Contributor

antekresic commented Jun 3, 2024

Hi again,

I've tried reproducing the issue with the data you have provided but had no luck.

Would you mind sharing the contents of your dimension, dimension_slice and chunk_constraint catalog tables? It would go a long way into debugging this issue.

You can get those like this:

SELECT * FROM _timescaledb_catalog.dimension;
SELECT * FROM _timescaledb_catalog.dimension_slice;
SELECT * FROM _timescaledb_catalog.chunk_constraint;

Thanks!

@gugu
Copy link
Author

gugu commented Jun 3, 2024

Output for this table:
dims.txt

@antekresic
Copy link
Contributor

One question here: did you update from 2.14.x to 2.15.1 directly or did you first update to 2.15.0?

We had an issue with one of the update scripts for 2.15.0 which might be the culprit here.

@gugu
Copy link
Author

gugu commented Jun 4, 2024 via email

@antekresic
Copy link
Contributor

Looks like you have hit a catalog corruption bug in the upgrade process. There is a PR out to fix it but we need to also restore the catalog for your instance in order to get the database in a working order.

I'm working on a script to fix the problem and will post it here once it's done.

Question: can you run it as a superuser on your environment? That will probably be necessary in order to fix the catalog.

@gugu
Copy link
Author

gugu commented Jun 5, 2024

Yes, I have superuser access

@antekresic
Copy link
Contributor

antekresic commented Jun 6, 2024

OK, so I have a couple of queries I would like you to run before we attempt fixing the catalog.

This one will show all the chunks that are broken:

WITH dimension_count as (                                                                                      
SELECT ht.id, count(*)
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.dimension d
        ON d.hypertable_id = ht.id
WHERE table_name = 'clicks'
GROUP BY 1),
chunk_constraint_count AS (
SELECT c.hypertable_id, cc.chunk_id, c.schema_name, c.table_name, count(*)
FROM _timescaledb_catalog.chunk_constraint cc
INNER JOIN _timescaledb_catalog.chunk c
        ON cc.chunk_id = c.id
GROUP BY 1, 2,3 ,4
)
SELECT dc.*, ccc.*
FROM chunk_constraint_count ccc
INNER JOIN dimension_count dc
ON dc.id = ccc.hypertable_id
WHERE dc.count != ccc.count;

And this one will show the catalog entries that need to be inserted:

WITH dimension_count as (
SELECT ht.id, count(*)
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.dimension d
        ON d.hypertable_id = ht.id
WHERE table_name = 'clicks'
GROUP BY 1),
chunk_constraint_count AS (
SELECT c.hypertable_id, cc.chunk_id, c.schema_name, c.table_name, count(*)
FROM _timescaledb_catalog.chunk_constraint cc
INNER JOIN _timescaledb_catalog.chunk c
        ON cc.chunk_id = c.id
GROUP BY 1, 2,3 ,4
)
SELECT ccc.chunk_id, tcc.dimension_slice_id, cc.constraint_name, null as hypertable_constraint_name
FROM information_schema.table_constraints tc
INNER JOIN chunk_constraint_count ccc 
ON ccc.schema_name = tc.table_schema
and ccc.table_name = tc.table_name
INNER JOIN dimension_count dc
ON dc.id = ccc.hypertable_id
INNER JOIN information_schema.check_constraints cc
ON tc.constraint_name = cc.constraint_name
INNER JOIN information_schema.check_constraints jcc
ON cc.check_clause = jcc.check_clause
AND jcc.constraint_name != cc.constraint_name
AND EXISTS (
        SELECT FROM _timescaledb_catalog.chunk_constraint
        WHERE chunk_constraint.constraint_name = jcc.constraint_name
)
INNER JOIN _timescaledb_catalog.chunk_constraint tcc
ON jcc.constraint_name = tcc.constraint_name
WHERE dc.count != ccc.count
and tc.constraint_name like 'constraint%'
and NOT EXISTS (
        SELECT FROM _timescaledb_catalog.chunk_constraint
        WHERE chunk_constraint.constraint_name = tc.constraint_name
        AND chunk_constraint.chunk_id = ccc.chunk_id
        AND chunk_constraint.hypertable_constraint_name IS NULL
);

Can you share the outputs of these queries?

Thanks,

@gugu
Copy link
Author

gugu commented Jun 6, 2024

timescale-us$ WITH dimension_count as (
SELECT ht.id, count(*)
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.dimension d
        ON d.hypertable_id = ht.id
WHERE table_name = 'space_partitioning'
GROUP BY 1),
chunk_constraint_count AS (
SELECT c.hypertable_id, cc.chunk_id, c.schema_name, c.table_name, count(*)
FROM _timescaledb_catalog.chunk_constraint cc
INNER JOIN _timescaledb_catalog.chunk c
        ON cc.chunk_id = c.id
GROUP BY 1, 2,3 ,4
)
SELECT dc.*, ccc.*
FROM chunk_constraint_count ccc
INNER JOIN dimension_count dc
ON dc.id = ccc.hypertable_id
WHERE dc.count != ccc.count;
 id | count | hypertable_id | chunk_id | schema_name | table_name | count
----+-------+---------------+----------+-------------+------------+-------
(0 rows)

@gugu
Copy link
Author

gugu commented Jun 6, 2024

┌──────────┬────────────────────┬─────────────────┬────────────────────────────┐
│ chunk_id │ dimension_slice_id │ constraint_name │ hypertable_constraint_name │
├──────────┼────────────────────┼─────────────────┼────────────────────────────┤
└──────────┴────────────────────┴─────────────────┴────────────────────────────┘

@antekresic
Copy link
Contributor

I'm so sorry, I didn't use your hypertable name. Can we try them again? I've updated the ht names:
#6976 (comment)

@gugu
Copy link
Author

gugu commented Jun 6, 2024

┌─────┬───────┬───────────────┬──────────┬───────────────────────┬───────────────────────┬───────┐
│ id  │ count │ hypertable_id │ chunk_id │      schema_name      │      table_name       │ count │
├─────┼───────┼───────────────┼──────────┼───────────────────────┼───────────────────────┼───────┤
│ 109 │     2 │           109 │     2432 │ _timescaledb_internal │ _hyper_109_2432_chunk │     1 │
│ 109 │     2 │           109 │     2251 │ _timescaledb_internal │ _hyper_109_2251_chunk │     1 │
│ 109 │     2 │           109 │     2786 │ _timescaledb_internal │ _hyper_109_2786_chunk │     1 │
│ 109 │     2 │           109 │     3372 │ _timescaledb_internal │ _hyper_109_3372_chunk │     1 │
│ 109 │     2 │           109 │     1979 │ _timescaledb_internal │ _hyper_109_1979_chunk │     1 │
│ 109 │     2 │           109 │     2051 │ _timescaledb_internal │ _hyper_109_2051_chunk │     1 │
│ 109 │     2 │           109 │     3762 │ _timescaledb_internal │ _hyper_109_3762_chunk │     1 │
│ 109 │     2 │           109 │     3736 │ _timescaledb_internal │ _hyper_109_3736_chunk │     1 │
│ 109 │     2 │           109 │     2758 │ _timescaledb_internal │ _hyper_109_2758_chunk │     1 │
│ 109 │     2 │           109 │     1922 │ _timescaledb_internal │ _hyper_109_1922_chunk │     1 │
│ 109 │     2 │           109 │     3022 │ _timescaledb_internal │ _hyper_109_3022_chunk │     1 │
│ 109 │     2 │           109 │     3970 │ _timescaledb_internal │ _hyper_109_3970_chunk │     1 │
│ 109 │     2 │           109 │     3278 │ _timescaledb_internal │ _hyper_109_3278_chunk │     1 │
│ 109 │     2 │           109 │     3420 │ _timescaledb_internal │ _hyper_109_3420_chunk │     1 │
│ 109 │     2 │           109 │     2192 │ _timescaledb_internal │ _hyper_109_2192_chunk │     1 │
│ 109 │     2 │           109 │     2075 │ _timescaledb_internal │ _hyper_109_2075_chunk │     1 │
│ 109 │     2 │           109 │     3969 │ _timescaledb_internal │ _hyper_109_3969_chunk │     1 │
│ 109 │     2 │           109 │     2077 │ _timescaledb_internal │ _hyper_109_2077_chunk │     1 │
│ 109 │     2 │           109 │     3637 │ _timescaledb_internal │ _hyper_109_3637_chunk │     1 │
│ 109 │     2 │           109 │     3058 │ _timescaledb_internal │ _hyper_109_3058_chunk │     1 │
│ 109 │     2 │           109 │     4227 │ _timescaledb_internal │ _hyper_109_4227_chunk │     1 │
│ 109 │     2 │           109 │     4104 │ _timescaledb_internal │ _hyper_109_4104_chunk │     1 │
│ 109 │     2 │           109 │     3947 │ _timescaledb_internal │ _hyper_109_3947_chunk │     1 │
│ 109 │     2 │           109 │     3946 │ _timescaledb_internal │ _hyper_109_3946_chunk │     1 │
│ 109 │     2 │           109 │     4228 │ _timescaledb_internal │ _hyper_109_4228_chunk │     1 │
│ 109 │     2 │           109 │     2840 │ _timescaledb_internal │ _hyper_109_2840_chunk │     1 │
│ 109 │     2 │           109 │     2578 │ _timescaledb_internal │ _hyper_109_2578_chunk │     1 │
│ 109 │     2 │           109 │     4222 │ _timescaledb_internal │ _hyper_109_4222_chunk │     1 │
│ 109 │     2 │           109 │     2781 │ _timescaledb_internal │ _hyper_109_2781_chunk │     1 │
│ 109 │     2 │           109 │     3971 │ _timescaledb_internal │ _hyper_109_3971_chunk │     1 │
│ 109 │     2 │           109 │     3238 │ _timescaledb_internal │ _hyper_109_3238_chunk │     1 │
│ 109 │     2 │           109 │     3536 │ _timescaledb_internal │ _hyper_109_3536_chunk │     1 │
│ 109 │     2 │           109 │     2788 │ _timescaledb_internal │ _hyper_109_2788_chunk │     1 │
│ 109 │     2 │           109 │     2787 │ _timescaledb_internal │ _hyper_109_2787_chunk │     1 │
│ 109 │     2 │           109 │     2430 │ _timescaledb_internal │ _hyper_109_2430_chunk │     1 │
│ 109 │     2 │           109 │     3239 │ _timescaledb_internal │ _hyper_109_3239_chunk │     1 │
│ 109 │     2 │           109 │     4183 │ _timescaledb_internal │ _hyper_109_4183_chunk │     1 │
│ 109 │     2 │           109 │     3217 │ _timescaledb_internal │ _hyper_109_3217_chunk │     1 │
│ 109 │     2 │           109 │     3537 │ _timescaledb_internal │ _hyper_109_3537_chunk │     1 │
│ 109 │     2 │           109 │     3544 │ _timescaledb_internal │ _hyper_109_3544_chunk │     1 │
│ 109 │     2 │           109 │     2024 │ _timescaledb_internal │ _hyper_109_2024_chunk │     1 │
│ 109 │     2 │           109 │     2490 │ _timescaledb_internal │ _hyper_109_2490_chunk │     1 │
│ 109 │     2 │           109 │     2194 │ _timescaledb_internal │ _hyper_109_2194_chunk │     1 │
│ 109 │     2 │           109 │     2841 │ _timescaledb_internal │ _hyper_109_2841_chunk │     1 │
│ 109 │     2 │           109 │     2488 │ _timescaledb_internal │ _hyper_109_2488_chunk │     1 │
│ 109 │     2 │           109 │     2842 │ _timescaledb_internal │ _hyper_109_2842_chunk │     1 │
│ 109 │     2 │           109 │     3018 │ _timescaledb_internal │ _hyper_109_3018_chunk │     1 │
│ 109 │     2 │           109 │     3513 │ _timescaledb_internal │ _hyper_109_3513_chunk │     1 │
│ 109 │     2 │           109 │     3331 │ _timescaledb_internal │ _hyper_109_3331_chunk │     1 │
│ 109 │     2 │           109 │     4223 │ _timescaledb_internal │ _hyper_109_4223_chunk │     1 │
│ 109 │     2 │           109 │     2576 │ _timescaledb_internal │ _hyper_109_2576_chunk │     1 │
│ 109 │     2 │           109 │     3371 │ _timescaledb_internal │ _hyper_109_3371_chunk │     1 │
│ 109 │     2 │           109 │     2495 │ _timescaledb_internal │ _hyper_109_2495_chunk │     1 │
│ 109 │     2 │           109 │     2757 │ _timescaledb_internal │ _hyper_109_2757_chunk │     1 │
│ 109 │     2 │           109 │     1793 │ _timescaledb_internal │ _hyper_109_1793_chunk │     1 │
│ 109 │     2 │           109 │     3057 │ _timescaledb_internal │ _hyper_109_3057_chunk │     1 │
│ 109 │     2 │           109 │     2518 │ _timescaledb_internal │ _hyper_109_2518_chunk │     1 │
│ 109 │     2 │           109 │     3216 │ _timescaledb_internal │ _hyper_109_3216_chunk │     1 │
│ 109 │     2 │           109 │     3211 │ _timescaledb_internal │ _hyper_109_3211_chunk │     1 │
│ 109 │     2 │           109 │     2630 │ _timescaledb_internal │ _hyper_109_2630_chunk │     1 │
│ 109 │     2 │           109 │     3454 │ _timescaledb_internal │ _hyper_109_3454_chunk │     1 │
│ 109 │     2 │           109 │     2323 │ _timescaledb_internal │ _hyper_109_2323_chunk │     1 │
│ 109 │     2 │           109 │     2780 │ _timescaledb_internal │ _hyper_109_2780_chunk │     1 │
│ 109 │     2 │           109 │     2282 │ _timescaledb_internal │ _hyper_109_2282_chunk │     1 │
│ 109 │     2 │           109 │     3569 │ _timescaledb_internal │ _hyper_109_3569_chunk │     1 │
│ 109 │     2 │           109 │     4103 │ _timescaledb_internal │ _hyper_109_4103_chunk │     1 │
│ 109 │     2 │           109 │     3515 │ _timescaledb_internal │ _hyper_109_3515_chunk │     1 │
│ 109 │     2 │           109 │     2050 │ _timescaledb_internal │ _hyper_109_2050_chunk │     1 │
│ 109 │     2 │           109 │     3333 │ _timescaledb_internal │ _hyper_109_3333_chunk │     1 │
│ 109 │     2 │           109 │     4229 │ _timescaledb_internal │ _hyper_109_4229_chunk │     1 │
│ 109 │     2 │           109 │     3016 │ _timescaledb_internal │ _hyper_109_3016_chunk │     1 │
│ 109 │     2 │           109 │     2193 │ _timescaledb_internal │ _hyper_109_2193_chunk │     1 │
│ 109 │     2 │           109 │     1870 │ _timescaledb_internal │ _hyper_109_1870_chunk │     1 │
│ 109 │     2 │           109 │     2086 │ _timescaledb_internal │ _hyper_109_2086_chunk │     1 │
│ 109 │     2 │           109 │     3240 │ _timescaledb_internal │ _hyper_109_3240_chunk │     1 │
│ 109 │     2 │           109 │     3811 │ _timescaledb_internal │ _hyper_109_3811_chunk │     1 │
│ 109 │     2 │           109 │     3413 │ _timescaledb_internal │ _hyper_109_3413_chunk │     1 │
│ 109 │     2 │           109 │     4181 │ _timescaledb_internal │ _hyper_109_4181_chunk │     1 │
│ 109 │     2 │           109 │     3209 │ _timescaledb_internal │ _hyper_109_3209_chunk │     1 │
│ 109 │     2 │           109 │     2461 │ _timescaledb_internal │ _hyper_109_2461_chunk │     1 │
│ 109 │     2 │           109 │     2322 │ _timescaledb_internal │ _hyper_109_2322_chunk │     1 │
│ 109 │     2 │           109 │     3302 │ _timescaledb_internal │ _hyper_109_3302_chunk │     1 │
│ 109 │     2 │           109 │     4159 │ _timescaledb_internal │ _hyper_109_4159_chunk │     1 │
│ 109 │     2 │           109 │     3415 │ _timescaledb_internal │ _hyper_109_3415_chunk │     1 │
│ 109 │     2 │           109 │     3788 │ _timescaledb_internal │ _hyper_109_3788_chunk │     1 │
│ 109 │     2 │           109 │     1980 │ _timescaledb_internal │ _hyper_109_1980_chunk │     1 │
│ 109 │     2 │           109 │     3735 │ _timescaledb_internal │ _hyper_109_3735_chunk │     1 │
│ 109 │     2 │           109 │     2023 │ _timescaledb_internal │ _hyper_109_2023_chunk │     1 │
│ 109 │     2 │           109 │     3636 │ _timescaledb_internal │ _hyper_109_3636_chunk │     1 │
│ 109 │     2 │           109 │     3488 │ _timescaledb_internal │ _hyper_109_3488_chunk │     1 │
│ 109 │     2 │           109 │     2076 │ _timescaledb_internal │ _hyper_109_2076_chunk │     1 │
│ 109 │     2 │           109 │     3741 │ _timescaledb_internal │ _hyper_109_3741_chunk │     1 │
│ 109 │     2 │           109 │     3487 │ _timescaledb_internal │ _hyper_109_3487_chunk │     1 │
│ 109 │     2 │           109 │     2281 │ _timescaledb_internal │ _hyper_109_2281_chunk │     1 │
│ 109 │     2 │           109 │     3844 │ _timescaledb_internal │ _hyper_109_3844_chunk │     1 │
│ 109 │     2 │           109 │     4160 │ _timescaledb_internal │ _hyper_109_4160_chunk │     1 │
│ 109 │     2 │           109 │     3279 │ _timescaledb_internal │ _hyper_109_3279_chunk │     1 │
│ 109 │     2 │           109 │     2280 │ _timescaledb_internal │ _hyper_109_2280_chunk │     1 │
│ 109 │     2 │           109 │     2914 │ _timescaledb_internal │ _hyper_109_2914_chunk │     1 │
│ 109 │     2 │           109 │     2489 │ _timescaledb_internal │ _hyper_109_2489_chunk │     1 │
│ 109 │     2 │           109 │     3111 │ _timescaledb_internal │ _hyper_109_3111_chunk │     1 │
│ 109 │     2 │           109 │     3444 │ _timescaledb_internal │ _hyper_109_3444_chunk │     1 │
│ 109 │     2 │           109 │     3570 │ _timescaledb_internal │ _hyper_109_3570_chunk │     1 │
│ 109 │     2 │           109 │     3332 │ _timescaledb_internal │ _hyper_109_3332_chunk │     1 │
│ 109 │     2 │           109 │     2519 │ _timescaledb_internal │ _hyper_109_2519_chunk │     1 │
│ 109 │     2 │           109 │     3845 │ _timescaledb_internal │ _hyper_109_3845_chunk │     1 │
│ 109 │     2 │           109 │     3761 │ _timescaledb_internal │ _hyper_109_3761_chunk │     1 │
│ 109 │     2 │           109 │     4105 │ _timescaledb_internal │ _hyper_109_4105_chunk │     1 │
│ 109 │     2 │           109 │     4182 │ _timescaledb_internal │ _hyper_109_4182_chunk │     1 │
│ 109 │     2 │           109 │     3421 │ _timescaledb_internal │ _hyper_109_3421_chunk │     1 │
│ 109 │     2 │           109 │     3912 │ _timescaledb_internal │ _hyper_109_3912_chunk │     1 │
│ 109 │     2 │           109 │     3673 │ _timescaledb_internal │ _hyper_109_3673_chunk │     1 │
│ 109 │     2 │           109 │     3760 │ _timescaledb_internal │ _hyper_109_3760_chunk │     1 │
│ 109 │     2 │           109 │     1921 │ _timescaledb_internal │ _hyper_109_1921_chunk │     1 │
│ 109 │     2 │           109 │     3568 │ _timescaledb_internal │ _hyper_109_3568_chunk │     1 │
│ 109 │     2 │           109 │     3446 │ _timescaledb_internal │ _hyper_109_3446_chunk │     1 │
│ 109 │     2 │           109 │     3050 │ _timescaledb_internal │ _hyper_109_3050_chunk │     1 │
│ 109 │     2 │           109 │     3787 │ _timescaledb_internal │ _hyper_109_3787_chunk │     1 │
│ 109 │     2 │           109 │     3304 │ _timescaledb_internal │ _hyper_109_3304_chunk │     1 │
│ 109 │     2 │           109 │     1923 │ _timescaledb_internal │ _hyper_109_1923_chunk │     1 │
│ 109 │     2 │           109 │     3300 │ _timescaledb_internal │ _hyper_109_3300_chunk │     1 │
│ 109 │     2 │           109 │     2079 │ _timescaledb_internal │ _hyper_109_2079_chunk │     1 │
│ 109 │     2 │           109 │     2465 │ _timescaledb_internal │ _hyper_109_2465_chunk │     1 │
│ 109 │     2 │           109 │     3672 │ _timescaledb_internal │ _hyper_109_3672_chunk │     1 │
│ 109 │     2 │           109 │     2520 │ _timescaledb_internal │ _hyper_109_2520_chunk │     1 │
│ 109 │     2 │           109 │     3017 │ _timescaledb_internal │ _hyper_109_3017_chunk │     1 │
│ 109 │     2 │           109 │     2228 │ _timescaledb_internal │ _hyper_109_2228_chunk │     1 │
│ 109 │     2 │           109 │     3128 │ _timescaledb_internal │ _hyper_109_3128_chunk │     1 │
│ 109 │     2 │           109 │     3809 │ _timescaledb_internal │ _hyper_109_3809_chunk │     1 │
│ 109 │     2 │           109 │     2759 │ _timescaledb_internal │ _hyper_109_2759_chunk │     1 │
│ 109 │     2 │           109 │     2397 │ _timescaledb_internal │ _hyper_109_2397_chunk │     1 │
│ 109 │     2 │           109 │     2049 │ _timescaledb_internal │ _hyper_109_2049_chunk │     1 │
│ 109 │     2 │           109 │     3452 │ _timescaledb_internal │ _hyper_109_3452_chunk │     1 │
│ 109 │     2 │           109 │     2912 │ _timescaledb_internal │ _hyper_109_2912_chunk │     1 │
│ 109 │     2 │           109 │     2459 │ _timescaledb_internal │ _hyper_109_2459_chunk │     1 │
│ 109 │     2 │           109 │     3635 │ _timescaledb_internal │ _hyper_109_3635_chunk │     1 │
│ 109 │     2 │           109 │     1794 │ _timescaledb_internal │ _hyper_109_1794_chunk │     1 │
│ 109 │     2 │           109 │     2431 │ _timescaledb_internal │ _hyper_109_2431_chunk │     1 │
│ 109 │     2 │           109 │     2398 │ _timescaledb_internal │ _hyper_109_2398_chunk │     1 │
│ 109 │     2 │           109 │     2324 │ _timescaledb_internal │ _hyper_109_2324_chunk │     1 │
│ 109 │     2 │           109 │     4098 │ _timescaledb_internal │ _hyper_109_4098_chunk │     1 │
│ 109 │     2 │           109 │     2252 │ _timescaledb_internal │ _hyper_109_2252_chunk │     1 │
│ 109 │     2 │           109 │     3056 │ _timescaledb_internal │ _hyper_109_3056_chunk │     1 │
│ 109 │     2 │           109 │     3843 │ _timescaledb_internal │ _hyper_109_3843_chunk │     1 │
│ 109 │     2 │           109 │     2782 │ _timescaledb_internal │ _hyper_109_2782_chunk │     1 │
│ 109 │     2 │           109 │     4097 │ _timescaledb_internal │ _hyper_109_4097_chunk │     1 │
│ 109 │     2 │           109 │     3215 │ _timescaledb_internal │ _hyper_109_3215_chunk │     1 │
│ 109 │     2 │           109 │     4099 │ _timescaledb_internal │ _hyper_109_4099_chunk │     1 │
│ 109 │     2 │           109 │     2629 │ _timescaledb_internal │ _hyper_109_2629_chunk │     1 │
│ 109 │     2 │           109 │     2259 │ _timescaledb_internal │ _hyper_109_2259_chunk │     1 │
│ 109 │     2 │           109 │     2466 │ _timescaledb_internal │ _hyper_109_2466_chunk │     1 │
│ 109 │     2 │           109 │     2628 │ _timescaledb_internal │ _hyper_109_2628_chunk │     1 │
│ 109 │     2 │           109 │     3613 │ _timescaledb_internal │ _hyper_109_3613_chunk │     1 │
│ 109 │     2 │           109 │     3023 │ _timescaledb_internal │ _hyper_109_3023_chunk │     1 │
│ 109 │     2 │           109 │     1978 │ _timescaledb_internal │ _hyper_109_1978_chunk │     1 │
│ 109 │     2 │           109 │     3021 │ _timescaledb_internal │ _hyper_109_3021_chunk │     1 │
│ 109 │     2 │           109 │     3112 │ _timescaledb_internal │ _hyper_109_3112_chunk │     1 │
│ 109 │     2 │           109 │     2229 │ _timescaledb_internal │ _hyper_109_2229_chunk │     1 │
│ 109 │     2 │           109 │     1868 │ _timescaledb_internal │ _hyper_109_1868_chunk │     1 │
│ 109 │     2 │           109 │     2253 │ _timescaledb_internal │ _hyper_109_2253_chunk │     1 │
│ 109 │     2 │           109 │     3976 │ _timescaledb_internal │ _hyper_109_3976_chunk │     1 │
│ 109 │     2 │           109 │     2078 │ _timescaledb_internal │ _hyper_109_2078_chunk │     1 │
│ 109 │     2 │           109 │     3977 │ _timescaledb_internal │ _hyper_109_3977_chunk │     1 │
│ 109 │     2 │           109 │     3210 │ _timescaledb_internal │ _hyper_109_3210_chunk │     1 │
│ 109 │     2 │           109 │     3740 │ _timescaledb_internal │ _hyper_109_3740_chunk │     1 │
│ 109 │     2 │           109 │     3786 │ _timescaledb_internal │ _hyper_109_3786_chunk │     1 │
│ 109 │     2 │           109 │     2258 │ _timescaledb_internal │ _hyper_109_2258_chunk │     1 │
│ 109 │     2 │           109 │     3514 │ _timescaledb_internal │ _hyper_109_3514_chunk │     1 │
│ 109 │     2 │           109 │     3419 │ _timescaledb_internal │ _hyper_109_3419_chunk │     1 │
│ 109 │     2 │           109 │     3674 │ _timescaledb_internal │ _hyper_109_3674_chunk │     1 │
│ 109 │     2 │           109 │     2496 │ _timescaledb_internal │ _hyper_109_2496_chunk │     1 │
│ 109 │     2 │           109 │     3301 │ _timescaledb_internal │ _hyper_109_3301_chunk │     1 │
│ 109 │     2 │           109 │     3277 │ _timescaledb_internal │ _hyper_109_3277_chunk │     1 │
│ 109 │     2 │           109 │     3911 │ _timescaledb_internal │ _hyper_109_3911_chunk │     1 │
│ 109 │     2 │           109 │     3614 │ _timescaledb_internal │ _hyper_109_3614_chunk │     1 │
│ 109 │     2 │           109 │     3810 │ _timescaledb_internal │ _hyper_109_3810_chunk │     1 │
│ 109 │     2 │           109 │     3453 │ _timescaledb_internal │ _hyper_109_3453_chunk │     1 │
│ 109 │     2 │           109 │     2399 │ _timescaledb_internal │ _hyper_109_2399_chunk │     1 │
│ 109 │     2 │           109 │     3445 │ _timescaledb_internal │ _hyper_109_3445_chunk │     1 │
│ 109 │     2 │           109 │     3615 │ _timescaledb_internal │ _hyper_109_3615_chunk │     1 │
│ 109 │     2 │           109 │     4221 │ _timescaledb_internal │ _hyper_109_4221_chunk │     1 │
│ 109 │     2 │           109 │     2577 │ _timescaledb_internal │ _hyper_109_2577_chunk │     1 │
│ 109 │     2 │           109 │     3127 │ _timescaledb_internal │ _hyper_109_3127_chunk │     1 │
│ 109 │     2 │           109 │     1869 │ _timescaledb_internal │ _hyper_109_1869_chunk │     1 │
│ 109 │     2 │           109 │     3542 │ _timescaledb_internal │ _hyper_109_3542_chunk │     1 │
│ 109 │     2 │           109 │     3489 │ _timescaledb_internal │ _hyper_109_3489_chunk │     1 │
│ 109 │     2 │           109 │     3910 │ _timescaledb_internal │ _hyper_109_3910_chunk │     1 │
│ 109 │     2 │           109 │     2467 │ _timescaledb_internal │ _hyper_109_2467_chunk │     1 │
│ 109 │     2 │           109 │     2257 │ _timescaledb_internal │ _hyper_109_2257_chunk │     1 │
│ 109 │     2 │           109 │     3299 │ _timescaledb_internal │ _hyper_109_3299_chunk │     1 │
│ 109 │     2 │           109 │     2913 │ _timescaledb_internal │ _hyper_109_2913_chunk │     1 │
│ 109 │     2 │           109 │     3535 │ _timescaledb_internal │ _hyper_109_3535_chunk │     1 │
│ 109 │     2 │           109 │     3948 │ _timescaledb_internal │ _hyper_109_3948_chunk │     1 │
│ 109 │     2 │           109 │     2460 │ _timescaledb_internal │ _hyper_109_2460_chunk │     1 │
│ 109 │     2 │           109 │     2085 │ _timescaledb_internal │ _hyper_109_2085_chunk │     1 │
│ 109 │     2 │           109 │     2022 │ _timescaledb_internal │ _hyper_109_2022_chunk │     1 │
│ 109 │     2 │           109 │     3113 │ _timescaledb_internal │ _hyper_109_3113_chunk │     1 │
│ 109 │     2 │           109 │     3414 │ _timescaledb_internal │ _hyper_109_3414_chunk │     1 │
│ 109 │     2 │           109 │     3742 │ _timescaledb_internal │ _hyper_109_3742_chunk │     1 │
│ 109 │     2 │           109 │     3303 │ _timescaledb_internal │ _hyper_109_3303_chunk │     1 │
│ 109 │     2 │           109 │     1795 │ _timescaledb_internal │ _hyper_109_1795_chunk │     1 │
│ 109 │     2 │           109 │     2074 │ _timescaledb_internal │ _hyper_109_2074_chunk │     1 │
│ 109 │     2 │           109 │     3734 │ _timescaledb_internal │ _hyper_109_3734_chunk │     1 │
│ 109 │     2 │           109 │     2494 │ _timescaledb_internal │ _hyper_109_2494_chunk │     1 │
│ 109 │     2 │           109 │     3052 │ _timescaledb_internal │ _hyper_109_3052_chunk │     1 │
│ 109 │     2 │           109 │     3975 │ _timescaledb_internal │ _hyper_109_3975_chunk │     1 │
│ 109 │     2 │           109 │     3051 │ _timescaledb_internal │ _hyper_109_3051_chunk │     1 │
│ 109 │     2 │           109 │     2230 │ _timescaledb_internal │ _hyper_109_2230_chunk │     1 │
│ 109 │     2 │           109 │     2084 │ _timescaledb_internal │ _hyper_109_2084_chunk │     1 │
│ 109 │     2 │           109 │     4158 │ _timescaledb_internal │ _hyper_109_4158_chunk │     1 │
│ 109 │     2 │           109 │     3129 │ _timescaledb_internal │ _hyper_109_3129_chunk │     1 │
│ 109 │     2 │           109 │     3543 │ _timescaledb_internal │ _hyper_109_3543_chunk │     1 │
│ 109 │     2 │           109 │     3373 │ _timescaledb_internal │ _hyper_109_3373_chunk │     1 │
└─────┴───────┴───────────────┴──────────┴───────────────────────┴───────────────────────┴───────┘
(213 rows)

@gugu
Copy link
Author

gugu commented Jun 6, 2024

┌──────────┬────────────────────┬─────────────────┬────────────────────────────┐
│ chunk_id │ dimension_slice_id │ constraint_name │ hypertable_constraint_name │
├──────────┼────────────────────┼─────────────────┼────────────────────────────┤
│     3786 │               2240 │ constraint_305  │ ∅                          │
│     3786 │               2240 │ constraint_305  │ ∅                          │
│     3786 │               2240 │ constraint_305  │ ∅                          │
│     3787 │               2241 │ constraint_303  │ ∅                          │
│     3787 │               2241 │ constraint_303  │ ∅                          │
│     3787 │               2241 │ constraint_303  │ ∅                          │
│     3788 │               2239 │ constraint_304  │ ∅                          │
│     3788 │               2239 │ constraint_304  │ ∅                          │
│     3788 │               2239 │ constraint_304  │ ∅                          │
│     3535 │               2240 │ constraint_305  │ ∅                          │
│     3535 │               2240 │ constraint_305  │ ∅                          │
│     3535 │               2240 │ constraint_305  │ ∅                          │
│     3127 │               2239 │ constraint_304  │ ∅                          │
│     3127 │               2239 │ constraint_304  │ ∅                          │
│     3127 │               2239 │ constraint_304  │ ∅                          │
│     3536 │               2241 │ constraint_303  │ ∅                          │
│     3536 │               2241 │ constraint_303  │ ∅                          │
│     3536 │               2241 │ constraint_303  │ ∅                          │
│     3537 │               2239 │ constraint_304  │ ∅                          │
│     3537 │               2239 │ constraint_304  │ ∅                          │
│     3537 │               2239 │ constraint_304  │ ∅                          │
│     3542 │               2239 │ constraint_304  │ ∅                          │
│     3542 │               2239 │ constraint_304  │ ∅                          │
│     3542 │               2239 │ constraint_304  │ ∅                          │
│     3543 │               2241 │ constraint_303  │ ∅                          │
│     3543 │               2241 │ constraint_303  │ ∅                          │
│     3543 │               2241 │ constraint_303  │ ∅                          │
│     3544 │               2240 │ constraint_305  │ ∅                          │
│     3544 │               2240 │ constraint_305  │ ∅                          │
│     3544 │               2240 │ constraint_305  │ ∅                          │
│     3613 │               2241 │ constraint_303  │ ∅                          │
│     3613 │               2241 │ constraint_303  │ ∅                          │
│     3613 │               2241 │ constraint_303  │ ∅                          │
│     3614 │               2239 │ constraint_304  │ ∅                          │
│     3614 │               2239 │ constraint_304  │ ∅                          │
│     3614 │               2239 │ constraint_304  │ ∅                          │
│     3568 │               2240 │ constraint_305  │ ∅                          │
│     3568 │               2240 │ constraint_305  │ ∅                          │
│     3568 │               2240 │ constraint_305  │ ∅                          │
│     3569 │               2239 │ constraint_304  │ ∅                          │
│     3569 │               2239 │ constraint_304  │ ∅                          │
│     3569 │               2239 │ constraint_304  │ ∅                          │
│     3570 │               2241 │ constraint_303  │ ∅                          │
│     3570 │               2241 │ constraint_303  │ ∅                          │
│     3570 │               2241 │ constraint_303  │ ∅                          │
│     3809 │               2241 │ constraint_303  │ ∅                          │
│     3809 │               2241 │ constraint_303  │ ∅                          │
│     3809 │               2241 │ constraint_303  │ ∅                          │
│     3810 │               2240 │ constraint_305  │ ∅                          │
│     3810 │               2240 │ constraint_305  │ ∅                          │
│     3810 │               2240 │ constraint_305  │ ∅                          │
│     3843 │               2239 │ constraint_304  │ ∅                          │
│     3843 │               2239 │ constraint_304  │ ∅                          │
│     3843 │               2239 │ constraint_304  │ ∅                          │
│     3615 │               2240 │ constraint_305  │ ∅                          │
│     3615 │               2240 │ constraint_305  │ ∅                          │
│     3615 │               2240 │ constraint_305  │ ∅                          │
│     3844 │               2240 │ constraint_305  │ ∅                          │
│     3844 │               2240 │ constraint_305  │ ∅                          │
│     3844 │               2240 │ constraint_305  │ ∅                          │
│     3811 │               2239 │ constraint_304  │ ∅                          │
│     3811 │               2239 │ constraint_304  │ ∅                          │
│     3811 │               2239 │ constraint_304  │ ∅                          │
│     3845 │               2241 │ constraint_303  │ ∅                          │
│     3845 │               2241 │ constraint_303  │ ∅                          │
│     3845 │               2241 │ constraint_303  │ ∅                          │
│     3672 │               2241 │ constraint_303  │ ∅                          │
│     3672 │               2241 │ constraint_303  │ ∅                          │
│     3672 │               2241 │ constraint_303  │ ∅                          │
│     3673 │               2240 │ constraint_305  │ ∅                          │
│     3673 │               2240 │ constraint_305  │ ∅                          │
│     3673 │               2240 │ constraint_305  │ ∅                          │
│     3674 │               2239 │ constraint_304  │ ∅                          │
│     3674 │               2239 │ constraint_304  │ ∅                          │
│     3674 │               2239 │ constraint_304  │ ∅                          │
│     3635 │               2240 │ constraint_305  │ ∅                          │
│     3635 │               2240 │ constraint_305  │ ∅                          │
│     3635 │               2240 │ constraint_305  │ ∅                          │
│     3636 │               2241 │ constraint_303  │ ∅                          │
│     3636 │               2241 │ constraint_303  │ ∅                          │
│     3636 │               2241 │ constraint_303  │ ∅                          │
│     3637 │               2239 │ constraint_304  │ ∅                          │
│     3637 │               2239 │ constraint_304  │ ∅                          │
│     3637 │               2239 │ constraint_304  │ ∅                          │
│     3910 │               2240 │ constraint_305  │ ∅                          │
│     3910 │               2240 │ constraint_305  │ ∅                          │
│     3910 │               2240 │ constraint_305  │ ∅                          │
│     3734 │               2241 │ constraint_303  │ ∅                          │
│     3734 │               2241 │ constraint_303  │ ∅                          │
│     3734 │               2241 │ constraint_303  │ ∅                          │
│     3735 │               2240 │ constraint_305  │ ∅                          │
│     3735 │               2240 │ constraint_305  │ ∅                          │
│     3735 │               2240 │ constraint_305  │ ∅                          │
│     3736 │               2239 │ constraint_304  │ ∅                          │
│     3736 │               2239 │ constraint_304  │ ∅                          │
│     3736 │               2239 │ constraint_304  │ ∅                          │
│     3740 │               2241 │ constraint_303  │ ∅                          │
│     3740 │               2241 │ constraint_303  │ ∅                          │
│     3740 │               2241 │ constraint_303  │ ∅                          │
│     3741 │               2240 │ constraint_305  │ ∅                          │
│     3741 │               2240 │ constraint_305  │ ∅                          │
│     3741 │               2240 │ constraint_305  │ ∅                          │
│     3742 │               2239 │ constraint_304  │ ∅                          │
│     3742 │               2239 │ constraint_304  │ ∅                          │
│     3742 │               2239 │ constraint_304  │ ∅                          │
│     3911 │               2241 │ constraint_303  │ ∅                          │
│     3911 │               2241 │ constraint_303  │ ∅                          │
│     3911 │               2241 │ constraint_303  │ ∅                          │
│     3912 │               2239 │ constraint_304  │ ∅                          │
│     3912 │               2239 │ constraint_304  │ ∅                          │
│     3912 │               2239 │ constraint_304  │ ∅                          │
│     3946 │               2241 │ constraint_303  │ ∅                          │
│     3946 │               2241 │ constraint_303  │ ∅                          │
│     3946 │               2241 │ constraint_303  │ ∅                          │
│     3947 │               2239 │ constraint_304  │ ∅                          │
│     3947 │               2239 │ constraint_304  │ ∅                          │
│     3947 │               2239 │ constraint_304  │ ∅                          │
│     3948 │               2240 │ constraint_305  │ ∅                          │
│     3948 │               2240 │ constraint_305  │ ∅                          │
│     3948 │               2240 │ constraint_305  │ ∅                          │
│     3760 │               2239 │ constraint_304  │ ∅                          │
│     3760 │               2239 │ constraint_304  │ ∅                          │
│     3760 │               2239 │ constraint_304  │ ∅                          │
│     3761 │               2241 │ constraint_303  │ ∅                          │
│     3761 │               2241 │ constraint_303  │ ∅                          │
│     3761 │               2241 │ constraint_303  │ ∅                          │
│     3762 │               2240 │ constraint_305  │ ∅                          │
│     3762 │               2240 │ constraint_305  │ ∅                          │
│     3762 │               2240 │ constraint_305  │ ∅                          │
│     3969 │               2240 │ constraint_305  │ ∅                          │
│     3969 │               2240 │ constraint_305  │ ∅                          │
│     3969 │               2240 │ constraint_305  │ ∅                          │
│     3970 │               2241 │ constraint_303  │ ∅                          │
│     3970 │               2241 │ constraint_303  │ ∅                          │
│     3970 │               2241 │ constraint_303  │ ∅                          │
│     3971 │               2239 │ constraint_304  │ ∅                          │
│     3971 │               2239 │ constraint_304  │ ∅                          │
│     3971 │               2239 │ constraint_304  │ ∅                          │
│     3975 │               2239 │ constraint_304  │ ∅                          │
│     3975 │               2239 │ constraint_304  │ ∅                          │
│     3975 │               2239 │ constraint_304  │ ∅                          │
│     3976 │               2241 │ constraint_303  │ ∅                          │
│     3976 │               2241 │ constraint_303  │ ∅                          │
│     3976 │               2241 │ constraint_303  │ ∅                          │
│     3977 │               2240 │ constraint_305  │ ∅                          │
│     3977 │               2240 │ constraint_305  │ ∅                          │
│     3977 │               2240 │ constraint_305  │ ∅                          │
│     4097 │               2240 │ constraint_305  │ ∅                          │
│     4097 │               2240 │ constraint_305  │ ∅                          │
│     4097 │               2240 │ constraint_305  │ ∅                          │
│     4098 │               2239 │ constraint_304  │ ∅                          │
│     4098 │               2239 │ constraint_304  │ ∅                          │
│     4098 │               2239 │ constraint_304  │ ∅                          │
│     4099 │               2241 │ constraint_303  │ ∅                          │
│     4099 │               2241 │ constraint_303  │ ∅                          │
│     4099 │               2241 │ constraint_303  │ ∅                          │
│     4103 │               2240 │ constraint_305  │ ∅                          │
│     4103 │               2240 │ constraint_305  │ ∅                          │
│     4103 │               2240 │ constraint_305  │ ∅                          │
│     4104 │               2241 │ constraint_303  │ ∅                          │
│     4104 │               2241 │ constraint_303  │ ∅                          │
│     4104 │               2241 │ constraint_303  │ ∅                          │
│     4105 │               2239 │ constraint_304  │ ∅                          │
│     4105 │               2239 │ constraint_304  │ ∅                          │
│     4105 │               2239 │ constraint_304  │ ∅                          │
│     4158 │               2241 │ constraint_303  │ ∅                          │
│     4158 │               2241 │ constraint_303  │ ∅                          │
│     4158 │               2241 │ constraint_303  │ ∅                          │
│     4159 │               2239 │ constraint_304  │ ∅                          │
│     4159 │               2239 │ constraint_304  │ ∅                          │
│     4159 │               2239 │ constraint_304  │ ∅                          │
│     4160 │               2240 │ constraint_305  │ ∅                          │
│     4160 │               2240 │ constraint_305  │ ∅                          │
│     4160 │               2240 │ constraint_305  │ ∅                          │
│     4181 │               2239 │ constraint_304  │ ∅                          │
│     4181 │               2239 │ constraint_304  │ ∅                          │
│     4181 │               2239 │ constraint_304  │ ∅                          │
│     4182 │               2240 │ constraint_305  │ ∅                          │
│     4182 │               2240 │ constraint_305  │ ∅                          │
│     4182 │               2240 │ constraint_305  │ ∅                          │
│     4183 │               2241 │ constraint_303  │ ∅                          │
│     4183 │               2241 │ constraint_303  │ ∅                          │
│     4183 │               2241 │ constraint_303  │ ∅                          │
│     3128 │               2240 │ constraint_305  │ ∅                          │
│     3128 │               2240 │ constraint_305  │ ∅                          │
│     3128 │               2240 │ constraint_305  │ ∅                          │
│     4221 │               2239 │ constraint_304  │ ∅                          │
│     4221 │               2239 │ constraint_304  │ ∅                          │
│     4221 │               2239 │ constraint_304  │ ∅                          │
│     4227 │               2241 │ constraint_303  │ ∅                          │
│     4227 │               2241 │ constraint_303  │ ∅                          │
│     4227 │               2241 │ constraint_303  │ ∅                          │
│     4222 │               2240 │ constraint_305  │ ∅                          │
│     4222 │               2240 │ constraint_305  │ ∅                          │
│     4222 │               2240 │ constraint_305  │ ∅                          │
│     4223 │               2241 │ constraint_303  │ ∅                          │
│     4223 │               2241 │ constraint_303  │ ∅                          │
│     4223 │               2241 │ constraint_303  │ ∅                          │
│     4228 │               2239 │ constraint_304  │ ∅                          │
│     4228 │               2239 │ constraint_304  │ ∅                          │
│     4228 │               2239 │ constraint_304  │ ∅                          │
│     4229 │               2240 │ constraint_305  │ ∅                          │
│     4229 │               2240 │ constraint_305  │ ∅                          │
│     4229 │               2240 │ constraint_305  │ ∅                          │
│     3129 │               2241 │ constraint_303  │ ∅                          │
│     3129 │               2241 │ constraint_303  │ ∅                          │
│     3129 │               2241 │ constraint_303  │ ∅                          │
│     3209 │               2241 │ constraint_303  │ ∅                          │
│     3209 │               2241 │ constraint_303  │ ∅                          │
│     3209 │               2241 │ constraint_303  │ ∅                          │
│     3210 │               2240 │ constraint_305  │ ∅                          │
│     3210 │               2240 │ constraint_305  │ ∅                          │
│     3210 │               2240 │ constraint_305  │ ∅                          │
│     3211 │               2239 │ constraint_304  │ ∅                          │
│     3211 │               2239 │ constraint_304  │ ∅                          │
│     3211 │               2239 │ constraint_304  │ ∅                          │
│     3215 │               2240 │ constraint_305  │ ∅                          │
│     3215 │               2240 │ constraint_305  │ ∅                          │
│     3215 │               2240 │ constraint_305  │ ∅                          │
│     3216 │               2241 │ constraint_303  │ ∅                          │
│     3216 │               2241 │ constraint_303  │ ∅                          │
│     3216 │               2241 │ constraint_303  │ ∅                          │
│     3217 │               2239 │ constraint_304  │ ∅                          │
│     3217 │               2239 │ constraint_304  │ ∅                          │
│     3217 │               2239 │ constraint_304  │ ∅                          │
│     3238 │               2240 │ constraint_305  │ ∅                          │
│     3238 │               2240 │ constraint_305  │ ∅                          │
│     3238 │               2240 │ constraint_305  │ ∅                          │
│     3239 │               2241 │ constraint_303  │ ∅                          │
│     3239 │               2241 │ constraint_303  │ ∅                          │
│     3239 │               2241 │ constraint_303  │ ∅                          │
│     3240 │               2239 │ constraint_304  │ ∅                          │
│     3240 │               2239 │ constraint_304  │ ∅                          │
│     3240 │               2239 │ constraint_304  │ ∅                          │
│     3277 │               2239 │ constraint_304  │ ∅                          │
│     3277 │               2239 │ constraint_304  │ ∅                          │
│     3277 │               2239 │ constraint_304  │ ∅                          │
│     3278 │               2240 │ constraint_305  │ ∅                          │
│     3278 │               2240 │ constraint_305  │ ∅                          │
│     3278 │               2240 │ constraint_305  │ ∅                          │
│     3279 │               2241 │ constraint_303  │ ∅                          │
│     3279 │               2241 │ constraint_303  │ ∅                          │
│     3279 │               2241 │ constraint_303  │ ∅                          │
│     3299 │               2241 │ constraint_303  │ ∅                          │
│     3299 │               2241 │ constraint_303  │ ∅                          │
│     3299 │               2241 │ constraint_303  │ ∅                          │
│     3300 │               2240 │ constraint_305  │ ∅                          │
│     3300 │               2240 │ constraint_305  │ ∅                          │
│     3300 │               2240 │ constraint_305  │ ∅                          │
│     3301 │               2239 │ constraint_304  │ ∅                          │
│     3301 │               2239 │ constraint_304  │ ∅                          │
│     3301 │               2239 │ constraint_304  │ ∅                          │
│     3302 │               2239 │ constraint_304  │ ∅                          │
│     3302 │               2239 │ constraint_304  │ ∅                          │
│     3302 │               2239 │ constraint_304  │ ∅                          │
│     3303 │               2241 │ constraint_303  │ ∅                          │
│     3303 │               2241 │ constraint_303  │ ∅                          │
│     3303 │               2241 │ constraint_303  │ ∅                          │
│     3304 │               2240 │ constraint_305  │ ∅                          │
│     3304 │               2240 │ constraint_305  │ ∅                          │
│     3304 │               2240 │ constraint_305  │ ∅                          │
│     3331 │               2239 │ constraint_304  │ ∅                          │
│     3331 │               2239 │ constraint_304  │ ∅                          │
│     3331 │               2239 │ constraint_304  │ ∅                          │
│     3332 │               2240 │ constraint_305  │ ∅                          │
│     3332 │               2240 │ constraint_305  │ ∅                          │
│     3332 │               2240 │ constraint_305  │ ∅                          │
│     3333 │               2241 │ constraint_303  │ ∅                          │
│     3333 │               2241 │ constraint_303  │ ∅                          │
│     3333 │               2241 │ constraint_303  │ ∅                          │
│     3371 │               2240 │ constraint_305  │ ∅                          │
│     3371 │               2240 │ constraint_305  │ ∅                          │
│     3371 │               2240 │ constraint_305  │ ∅                          │
│     3372 │               2241 │ constraint_303  │ ∅                          │
│     3372 │               2241 │ constraint_303  │ ∅                          │
│     3372 │               2241 │ constraint_303  │ ∅                          │
│     3373 │               2239 │ constraint_304  │ ∅                          │
│     3373 │               2239 │ constraint_304  │ ∅                          │
│     3373 │               2239 │ constraint_304  │ ∅                          │
│     3413 │               2241 │ constraint_303  │ ∅                          │
│     3413 │               2241 │ constraint_303  │ ∅                          │
│     3413 │               2241 │ constraint_303  │ ∅                          │
│     3414 │               2240 │ constraint_305  │ ∅                          │
│     3414 │               2240 │ constraint_305  │ ∅                          │
│     3414 │               2240 │ constraint_305  │ ∅                          │
│     3415 │               2239 │ constraint_304  │ ∅                          │
│     3415 │               2239 │ constraint_304  │ ∅                          │
│     3415 │               2239 │ constraint_304  │ ∅                          │
│     3419 │               2239 │ constraint_304  │ ∅                          │
│     3419 │               2239 │ constraint_304  │ ∅                          │
│     3419 │               2239 │ constraint_304  │ ∅                          │
│     3420 │               2241 │ constraint_303  │ ∅                          │
│     3420 │               2241 │ constraint_303  │ ∅                          │
│     3420 │               2241 │ constraint_303  │ ∅                          │
│     3421 │               2240 │ constraint_305  │ ∅                          │
│     3421 │               2240 │ constraint_305  │ ∅                          │
│     3421 │               2240 │ constraint_305  │ ∅                          │
│     3444 │               2240 │ constraint_305  │ ∅                          │
│     3444 │               2240 │ constraint_305  │ ∅                          │
│     3444 │               2240 │ constraint_305  │ ∅                          │
│     3445 │               2241 │ constraint_303  │ ∅                          │
│     3445 │               2241 │ constraint_303  │ ∅                          │
│     3445 │               2241 │ constraint_303  │ ∅                          │
│     3446 │               2239 │ constraint_304  │ ∅                          │
│     3446 │               2239 │ constraint_304  │ ∅                          │
│     3446 │               2239 │ constraint_304  │ ∅                          │
│     3452 │               2240 │ constraint_305  │ ∅                          │
│     3452 │               2240 │ constraint_305  │ ∅                          │
│     3452 │               2240 │ constraint_305  │ ∅                          │
│     3453 │               2241 │ constraint_303  │ ∅                          │
│     3453 │               2241 │ constraint_303  │ ∅                          │
│     3453 │               2241 │ constraint_303  │ ∅                          │
│     3454 │               2239 │ constraint_304  │ ∅                          │
│     3454 │               2239 │ constraint_304  │ ∅                          │
│     3454 │               2239 │ constraint_304  │ ∅                          │
│     3487 │               2240 │ constraint_305  │ ∅                          │
│     3487 │               2240 │ constraint_305  │ ∅                          │
│     3487 │               2240 │ constraint_305  │ ∅                          │
│     1793 │               2239 │ constraint_304  │ ∅                          │
│     1793 │               2239 │ constraint_304  │ ∅                          │
│     1793 │               2239 │ constraint_304  │ ∅                          │
│     1794 │               2240 │ constraint_305  │ ∅                          │
│     1794 │               2240 │ constraint_305  │ ∅                          │
│     1794 │               2240 │ constraint_305  │ ∅                          │
│     1795 │               2241 │ constraint_303  │ ∅                          │
│     1795 │               2241 │ constraint_303  │ ∅                          │
│     1795 │               2241 │ constraint_303  │ ∅                          │
│     3488 │               2241 │ constraint_303  │ ∅                          │
│     3488 │               2241 │ constraint_303  │ ∅                          │
│     3488 │               2241 │ constraint_303  │ ∅                          │
│     3489 │               2239 │ constraint_304  │ ∅                          │
│     3489 │               2239 │ constraint_304  │ ∅                          │
│     3489 │               2239 │ constraint_304  │ ∅                          │
│     1868 │               2240 │ constraint_305  │ ∅                          │
│     1868 │               2240 │ constraint_305  │ ∅                          │
│     1868 │               2240 │ constraint_305  │ ∅                          │
│     1869 │               2241 │ constraint_303  │ ∅                          │
│     1869 │               2241 │ constraint_303  │ ∅                          │
│     1869 │               2241 │ constraint_303  │ ∅                          │
│     1870 │               2239 │ constraint_304  │ ∅                          │
│     1870 │               2239 │ constraint_304  │ ∅                          │
│     1870 │               2239 │ constraint_304  │ ∅                          │
│     3513 │               2241 │ constraint_303  │ ∅                          │
│     3513 │               2241 │ constraint_303  │ ∅                          │
│     3513 │               2241 │ constraint_303  │ ∅                          │
│     3514 │               2239 │ constraint_304  │ ∅                          │
│     3514 │               2239 │ constraint_304  │ ∅                          │
│     3514 │               2239 │ constraint_304  │ ∅                          │
│     3515 │               2240 │ constraint_305  │ ∅                          │
│     3515 │               2240 │ constraint_305  │ ∅                          │
│     3515 │               2240 │ constraint_305  │ ∅                          │
│     1921 │               2239 │ constraint_304  │ ∅                          │
│     1921 │               2239 │ constraint_304  │ ∅                          │
│     1921 │               2239 │ constraint_304  │ ∅                          │
│     1922 │               2240 │ constraint_305  │ ∅                          │
│     1922 │               2240 │ constraint_305  │ ∅                          │
│     1922 │               2240 │ constraint_305  │ ∅                          │
│     1923 │               2241 │ constraint_303  │ ∅                          │
│     1923 │               2241 │ constraint_303  │ ∅                          │
│     1923 │               2241 │ constraint_303  │ ∅                          │
│     1978 │               2239 │ constraint_304  │ ∅                          │
│     1978 │               2239 │ constraint_304  │ ∅                          │
│     1978 │               2239 │ constraint_304  │ ∅                          │
│     1979 │               2240 │ constraint_305  │ ∅                          │
│     1979 │               2240 │ constraint_305  │ ∅                          │
│     1979 │               2240 │ constraint_305  │ ∅                          │
│     1980 │               2241 │ constraint_303  │ ∅                          │
│     1980 │               2241 │ constraint_303  │ ∅                          │
│     1980 │               2241 │ constraint_303  │ ∅                          │
│     2022 │               2239 │ constraint_304  │ ∅                          │
│     2022 │               2239 │ constraint_304  │ ∅                          │
│     2022 │               2239 │ constraint_304  │ ∅                          │
│     2023 │               2241 │ constraint_303  │ ∅                          │
│     2023 │               2241 │ constraint_303  │ ∅                          │
│     2023 │               2241 │ constraint_303  │ ∅                          │
│     2024 │               2240 │ constraint_305  │ ∅                          │
│     2024 │               2240 │ constraint_305  │ ∅                          │
│     2024 │               2240 │ constraint_305  │ ∅                          │
│     2049 │               2240 │ constraint_305  │ ∅                          │
│     2049 │               2240 │ constraint_305  │ ∅                          │
│     2049 │               2240 │ constraint_305  │ ∅                          │
│     2050 │               2241 │ constraint_303  │ ∅                          │
│     2050 │               2241 │ constraint_303  │ ∅                          │
│     2050 │               2241 │ constraint_303  │ ∅                          │
│     2051 │               2239 │ constraint_304  │ ∅                          │
│     2051 │               2239 │ constraint_304  │ ∅                          │
│     2051 │               2239 │ constraint_304  │ ∅                          │
│     2074 │               2240 │ constraint_305  │ ∅                          │
│     2074 │               2240 │ constraint_305  │ ∅                          │
│     2074 │               2240 │ constraint_305  │ ∅                          │
│     2075 │               2241 │ constraint_303  │ ∅                          │
│     2075 │               2241 │ constraint_303  │ ∅                          │
│     2075 │               2241 │ constraint_303  │ ∅                          │
│     2076 │               2239 │ constraint_304  │ ∅                          │
│     2076 │               2239 │ constraint_304  │ ∅                          │
│     2076 │               2239 │ constraint_304  │ ∅                          │
│     2077 │               2239 │ constraint_304  │ ∅                          │
│     2077 │               2239 │ constraint_304  │ ∅                          │
│     2077 │               2239 │ constraint_304  │ ∅                          │
│     2078 │               2241 │ constraint_303  │ ∅                          │
│     2078 │               2241 │ constraint_303  │ ∅                          │
│     2078 │               2241 │ constraint_303  │ ∅                          │
│     2229 │               2240 │ constraint_305  │ ∅                          │
│     2229 │               2240 │ constraint_305  │ ∅                          │
│     2229 │               2240 │ constraint_305  │ ∅                          │
│     2079 │               2240 │ constraint_305  │ ∅                          │
│     2079 │               2240 │ constraint_305  │ ∅                          │
│     2079 │               2240 │ constraint_305  │ ∅                          │
│     2084 │               2239 │ constraint_304  │ ∅                          │
│     2084 │               2239 │ constraint_304  │ ∅                          │
│     2084 │               2239 │ constraint_304  │ ∅                          │
│     2085 │               2241 │ constraint_303  │ ∅                          │
│     2085 │               2241 │ constraint_303  │ ∅                          │
│     2085 │               2241 │ constraint_303  │ ∅                          │
│     2086 │               2240 │ constraint_305  │ ∅                          │
│     2086 │               2240 │ constraint_305  │ ∅                          │
│     2086 │               2240 │ constraint_305  │ ∅                          │
│     2192 │               2240 │ constraint_305  │ ∅                          │
│     2192 │               2240 │ constraint_305  │ ∅                          │
│     2192 │               2240 │ constraint_305  │ ∅                          │
│     2193 │               2239 │ constraint_304  │ ∅                          │
│     2193 │               2239 │ constraint_304  │ ∅                          │
│     2193 │               2239 │ constraint_304  │ ∅                          │
│     2194 │               2241 │ constraint_303  │ ∅                          │
│     2194 │               2241 │ constraint_303  │ ∅                          │
│     2194 │               2241 │ constraint_303  │ ∅                          │
│     2228 │               2241 │ constraint_303  │ ∅                          │
│     2228 │               2241 │ constraint_303  │ ∅                          │
│     2228 │               2241 │ constraint_303  │ ∅                          │
│     2230 │               2239 │ constraint_304  │ ∅                          │
│     2230 │               2239 │ constraint_304  │ ∅                          │
│     2230 │               2239 │ constraint_304  │ ∅                          │
│     2251 │               2240 │ constraint_305  │ ∅                          │
│     2251 │               2240 │ constraint_305  │ ∅                          │
│     2251 │               2240 │ constraint_305  │ ∅                          │
│     2252 │               2239 │ constraint_304  │ ∅                          │
│     2252 │               2239 │ constraint_304  │ ∅                          │
│     2252 │               2239 │ constraint_304  │ ∅                          │
│     2253 │               2241 │ constraint_303  │ ∅                          │
│     2253 │               2241 │ constraint_303  │ ∅                          │
│     2253 │               2241 │ constraint_303  │ ∅                          │
│     2257 │               2240 │ constraint_305  │ ∅                          │
│     2257 │               2240 │ constraint_305  │ ∅                          │
│     2257 │               2240 │ constraint_305  │ ∅                          │
│     2258 │               2241 │ constraint_303  │ ∅                          │
│     2258 │               2241 │ constraint_303  │ ∅                          │
│     2258 │               2241 │ constraint_303  │ ∅                          │
│     2259 │               2239 │ constraint_304  │ ∅                          │
│     2259 │               2239 │ constraint_304  │ ∅                          │
│     2259 │               2239 │ constraint_304  │ ∅                          │
│     2280 │               2241 │ constraint_303  │ ∅                          │
│     2280 │               2241 │ constraint_303  │ ∅                          │
│     2280 │               2241 │ constraint_303  │ ∅                          │
│     2281 │               2239 │ constraint_304  │ ∅                          │
│     2281 │               2239 │ constraint_304  │ ∅                          │
│     2281 │               2239 │ constraint_304  │ ∅                          │
│     2282 │               2240 │ constraint_305  │ ∅                          │
│     2282 │               2240 │ constraint_305  │ ∅                          │
│     2282 │               2240 │ constraint_305  │ ∅                          │
│     2322 │               2241 │ constraint_303  │ ∅                          │
│     2322 │               2241 │ constraint_303  │ ∅                          │
│     2322 │               2241 │ constraint_303  │ ∅                          │
│     2323 │               2239 │ constraint_304  │ ∅                          │
│     2323 │               2239 │ constraint_304  │ ∅                          │
│     2323 │               2239 │ constraint_304  │ ∅                          │
│     2324 │               2240 │ constraint_305  │ ∅                          │
│     2324 │               2240 │ constraint_305  │ ∅                          │
│     2324 │               2240 │ constraint_305  │ ∅                          │
│     2397 │               2240 │ constraint_305  │ ∅                          │
│     2397 │               2240 │ constraint_305  │ ∅                          │
│     2397 │               2240 │ constraint_305  │ ∅                          │
│     2398 │               2239 │ constraint_304  │ ∅                          │
│     2398 │               2239 │ constraint_304  │ ∅                          │
│     2398 │               2239 │ constraint_304  │ ∅                          │
│     2399 │               2241 │ constraint_303  │ ∅                          │
│     2399 │               2241 │ constraint_303  │ ∅                          │
│     2399 │               2241 │ constraint_303  │ ∅                          │
│     2430 │               2241 │ constraint_303  │ ∅                          │
│     2430 │               2241 │ constraint_303  │ ∅                          │
│     2430 │               2241 │ constraint_303  │ ∅                          │
│     2431 │               2240 │ constraint_305  │ ∅                          │
│     2431 │               2240 │ constraint_305  │ ∅                          │
│     2431 │               2240 │ constraint_305  │ ∅                          │
│     2432 │               2239 │ constraint_304  │ ∅                          │
│     2432 │               2239 │ constraint_304  │ ∅                          │
│     2432 │               2239 │ constraint_304  │ ∅                          │
│     2459 │               2240 │ constraint_305  │ ∅                          │
│     2459 │               2240 │ constraint_305  │ ∅                          │
│     2459 │               2240 │ constraint_305  │ ∅                          │
│     2460 │               2239 │ constraint_304  │ ∅                          │
│     2460 │               2239 │ constraint_304  │ ∅                          │
│     2460 │               2239 │ constraint_304  │ ∅                          │
│     2461 │               2241 │ constraint_303  │ ∅                          │
│     2461 │               2241 │ constraint_303  │ ∅                          │
│     2461 │               2241 │ constraint_303  │ ∅                          │
│     2465 │               2240 │ constraint_305  │ ∅                          │
│     2465 │               2240 │ constraint_305  │ ∅                          │
│     2465 │               2240 │ constraint_305  │ ∅                          │
│     2466 │               2241 │ constraint_303  │ ∅                          │
│     2466 │               2241 │ constraint_303  │ ∅                          │
│     2466 │               2241 │ constraint_303  │ ∅                          │
│     2467 │               2239 │ constraint_304  │ ∅                          │
│     2467 │               2239 │ constraint_304  │ ∅                          │
│     2467 │               2239 │ constraint_304  │ ∅                          │
│     2488 │               2240 │ constraint_305  │ ∅                          │
│     2488 │               2240 │ constraint_305  │ ∅                          │
│     2488 │               2240 │ constraint_305  │ ∅                          │
│     2489 │               2239 │ constraint_304  │ ∅                          │
│     2489 │               2239 │ constraint_304  │ ∅                          │
│     2489 │               2239 │ constraint_304  │ ∅                          │
│     2490 │               2241 │ constraint_303  │ ∅                          │
│     2490 │               2241 │ constraint_303  │ ∅                          │
│     2490 │               2241 │ constraint_303  │ ∅                          │
│     2494 │               2239 │ constraint_304  │ ∅                          │
│     2494 │               2239 │ constraint_304  │ ∅                          │
│     2494 │               2239 │ constraint_304  │ ∅                          │
│     2495 │               2241 │ constraint_303  │ ∅                          │
│     2495 │               2241 │ constraint_303  │ ∅                          │
│     2495 │               2241 │ constraint_303  │ ∅                          │
│     2496 │               2240 │ constraint_305  │ ∅                          │
│     2496 │               2240 │ constraint_305  │ ∅                          │
│     2496 │               2240 │ constraint_305  │ ∅                          │
│     2518 │               2241 │ constraint_303  │ ∅                          │
│     2518 │               2241 │ constraint_303  │ ∅                          │
│     2518 │               2241 │ constraint_303  │ ∅                          │
│     2519 │               2240 │ constraint_305  │ ∅                          │
│     2519 │               2240 │ constraint_305  │ ∅                          │
│     2519 │               2240 │ constraint_305  │ ∅                          │
│     2520 │               2239 │ constraint_304  │ ∅                          │
│     2520 │               2239 │ constraint_304  │ ∅                          │
│     2520 │               2239 │ constraint_304  │ ∅                          │
│     2576 │               2241 │ constraint_303  │ ∅                          │
│     2576 │               2241 │ constraint_303  │ ∅                          │
│     2576 │               2241 │ constraint_303  │ ∅                          │
│     2577 │               2240 │ constraint_305  │ ∅                          │
│     2577 │               2240 │ constraint_305  │ ∅                          │
│     2577 │               2240 │ constraint_305  │ ∅                          │
│     2578 │               2239 │ constraint_304  │ ∅                          │
│     2578 │               2239 │ constraint_304  │ ∅                          │
│     2578 │               2239 │ constraint_304  │ ∅                          │
│     2628 │               2240 │ constraint_305  │ ∅                          │
│     2628 │               2240 │ constraint_305  │ ∅                          │
│     2628 │               2240 │ constraint_305  │ ∅                          │
│     2629 │               2241 │ constraint_303  │ ∅                          │
│     2629 │               2241 │ constraint_303  │ ∅                          │
│     2629 │               2241 │ constraint_303  │ ∅                          │
│     2630 │               2239 │ constraint_304  │ ∅                          │
│     2630 │               2239 │ constraint_304  │ ∅                          │
│     2630 │               2239 │ constraint_304  │ ∅                          │
│     2757 │               2240 │ constraint_305  │ ∅                          │
│     2757 │               2240 │ constraint_305  │ ∅                          │
│     2757 │               2240 │ constraint_305  │ ∅                          │
│     2758 │               2239 │ constraint_304  │ ∅                          │
│     2758 │               2239 │ constraint_304  │ ∅                          │
│     2758 │               2239 │ constraint_304  │ ∅                          │
│     2759 │               2241 │ constraint_303  │ ∅                          │
│     2759 │               2241 │ constraint_303  │ ∅                          │
│     2759 │               2241 │ constraint_303  │ ∅                          │
│     2780 │               2240 │ constraint_305  │ ∅                          │
│     2780 │               2240 │ constraint_305  │ ∅                          │
│     2780 │               2240 │ constraint_305  │ ∅                          │
│     2781 │               2239 │ constraint_304  │ ∅                          │
│     2781 │               2239 │ constraint_304  │ ∅                          │
│     2781 │               2239 │ constraint_304  │ ∅                          │
│     2782 │               2241 │ constraint_303  │ ∅                          │
│     2782 │               2241 │ constraint_303  │ ∅                          │
│     2782 │               2241 │ constraint_303  │ ∅                          │
│     2786 │               2240 │ constraint_305  │ ∅                          │
│     2786 │               2240 │ constraint_305  │ ∅                          │
│     2786 │               2240 │ constraint_305  │ ∅                          │
│     2787 │               2241 │ constraint_303  │ ∅                          │
│     2787 │               2241 │ constraint_303  │ ∅                          │
│     2787 │               2241 │ constraint_303  │ ∅                          │
│     2788 │               2239 │ constraint_304  │ ∅                          │
│     2788 │               2239 │ constraint_304  │ ∅                          │
│     2788 │               2239 │ constraint_304  │ ∅                          │
│     2840 │               2241 │ constraint_303  │ ∅                          │
│     2840 │               2241 │ constraint_303  │ ∅                          │
│     2840 │               2241 │ constraint_303  │ ∅                          │
│     2841 │               2239 │ constraint_304  │ ∅                          │
│     2841 │               2239 │ constraint_304  │ ∅                          │
│     2841 │               2239 │ constraint_304  │ ∅                          │
│     2842 │               2240 │ constraint_305  │ ∅                          │
│     2842 │               2240 │ constraint_305  │ ∅                          │
│     2842 │               2240 │ constraint_305  │ ∅                          │
│     2912 │               2241 │ constraint_303  │ ∅                          │
│     2912 │               2241 │ constraint_303  │ ∅                          │
│     2912 │               2241 │ constraint_303  │ ∅                          │
│     2913 │               2240 │ constraint_305  │ ∅                          │
│     2913 │               2240 │ constraint_305  │ ∅                          │
│     2913 │               2240 │ constraint_305  │ ∅                          │
│     2914 │               2239 │ constraint_304  │ ∅                          │
│     2914 │               2239 │ constraint_304  │ ∅                          │
│     2914 │               2239 │ constraint_304  │ ∅                          │
│     3016 │               2241 │ constraint_303  │ ∅                          │
│     3016 │               2241 │ constraint_303  │ ∅                          │
│     3016 │               2241 │ constraint_303  │ ∅                          │
│     3017 │               2240 │ constraint_305  │ ∅                          │
│     3017 │               2240 │ constraint_305  │ ∅                          │
│     3017 │               2240 │ constraint_305  │ ∅                          │
│     3018 │               2239 │ constraint_304  │ ∅                          │
│     3018 │               2239 │ constraint_304  │ ∅                          │
│     3018 │               2239 │ constraint_304  │ ∅                          │
│     3021 │               2239 │ constraint_304  │ ∅                          │
│     3021 │               2239 │ constraint_304  │ ∅                          │
│     3021 │               2239 │ constraint_304  │ ∅                          │
│     3022 │               2241 │ constraint_303  │ ∅                          │
│     3022 │               2241 │ constraint_303  │ ∅                          │
│     3022 │               2241 │ constraint_303  │ ∅                          │
│     3056 │               2241 │ constraint_303  │ ∅                          │
│     3056 │               2241 │ constraint_303  │ ∅                          │
│     3056 │               2241 │ constraint_303  │ ∅                          │
│     3023 │               2240 │ constraint_305  │ ∅                          │
│     3023 │               2240 │ constraint_305  │ ∅                          │
│     3023 │               2240 │ constraint_305  │ ∅                          │
│     3050 │               2239 │ constraint_304  │ ∅                          │
│     3050 │               2239 │ constraint_304  │ ∅                          │
│     3050 │               2239 │ constraint_304  │ ∅                          │
│     3051 │               2240 │ constraint_305  │ ∅                          │
│     3051 │               2240 │ constraint_305  │ ∅                          │
│     3051 │               2240 │ constraint_305  │ ∅                          │
│     3052 │               2241 │ constraint_303  │ ∅                          │
│     3052 │               2241 │ constraint_303  │ ∅                          │
│     3052 │               2241 │ constraint_303  │ ∅                          │
│     3057 │               2240 │ constraint_305  │ ∅                          │
│     3057 │               2240 │ constraint_305  │ ∅                          │
│     3057 │               2240 │ constraint_305  │ ∅                          │
│     3058 │               2239 │ constraint_304  │ ∅                          │
│     3058 │               2239 │ constraint_304  │ ∅                          │
│     3058 │               2239 │ constraint_304  │ ∅                          │
│     3111 │               2241 │ constraint_303  │ ∅                          │
│     3111 │               2241 │ constraint_303  │ ∅                          │
│     3111 │               2241 │ constraint_303  │ ∅                          │
│     3112 │               2240 │ constraint_305  │ ∅                          │
│     3112 │               2240 │ constraint_305  │ ∅                          │
│     3112 │               2240 │ constraint_305  │ ∅                          │
│     3113 │               2239 │ constraint_304  │ ∅                          │
│     3113 │               2239 │ constraint_304  │ ∅                          │
│     3113 │               2239 │ constraint_304  │ ∅                          │
└──────────┴────────────────────┴─────────────────┴────────────────────────────┘
(639 rows)

fabriziomello added a commit to fabriziomello/timescaledb that referenced this issue Jun 6, 2024
This release contains performance improvements and bug fixes since
the 2.15.0 release. Best practice is to upgrade at the next
available opportunity.

**Migrating from self-hosted TimescaleDB v2.14.x and earlier**

After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [timescale#6797](timescale#6797).

If you are migrating from TimescaleDB v2.15.0 or v2.15.1, no changes are required.

**Bugfixes**
* timescale#6975: Fix sort pushdown for partially compressed chunks.
* timescale#6976: Fix removal of metadata function and update script.
* timescale#6978: Fix segfault in compress_chunk with primary space partition.
* timescale#6993: Disallow hash partitioning on primary column.

**Thanks**
* @gugu for reporting the issue with catalog corruption due to update.
* @srieding for reporting an issue with partially compressed chunks and ordering on joined columns.
fabriziomello added a commit to fabriziomello/timescaledb that referenced this issue Jun 6, 2024
This release contains performance improvements and bug fixes since
the 2.15.0 release. Best practice is to upgrade at the next
available opportunity.

**Migrating from self-hosted TimescaleDB v2.14.x and earlier**

After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [timescale#6797](timescale#6797).

If you are migrating from TimescaleDB v2.15.0 or v2.15.1, no changes are required.

**Bugfixes**
* timescale#6975: Fix sort pushdown for partially compressed chunks.
* timescale#6976: Fix removal of metadata function and update script.
* timescale#6978: Fix segfault in compress_chunk with primary space partition.
* timescale#6993: Disallow hash partitioning on primary column.

**Thanks**
* @gugu for reporting the issue with catalog corruption due to update.
* @srieding for reporting an issue with partially compressed chunks and ordering on joined columns.
pallavisontakke added a commit to pallavisontakke/timescaledb that referenced this issue Jun 7, 2024
This release contains performance improvements and bug fixes since
the 2.15.1 release. Best practice is to upgrade at the next
available opportunity.

**Bugfixes**
* timescale#6975: Fix sort pushdown for partially compressed chunks.
* timescale#6976: Fix removal of metadata function and the update script.
* timescale#6978: Fix segfault in compress_chunk with primary space partition.
* timescale#6993: Disallow hash partitioning on the primary column.

**Thanks**
* @gugu for reporting the issue with catalog corruption due to update.
* @srieding for reporting the issue with partially compressed chunks and ordering on joined columns.
pallavisontakke added a commit that referenced this issue Jun 7, 2024
This release contains bug fixes since the
2.15.1 release. Best practice is to upgrade at the next available
opportunity.

**Bugfixes**
* #6975: Fix sort pushdown for partially compressed chunks.
* #6976: Fix removal of metadata function and the update script.
* #6978: Fix segfault in `compress_chunk` with primary space partition.
* #6993: Disallow hash partitioning on the primary column.

**Thanks**
* @gugu for reporting the issue with catalog corruption due to update.
* @srieding for reporting the issue with partially compressed chunks and
ordering on joined columns.
@antekresic
Copy link
Contributor

I see a problem in the second query, I have made a minor tweak. Can we give this a try?

WITH dimension_count as (
SELECT ht.id, count(*)
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.dimension d
	ON d.hypertable_id = ht.id
WHERE table_name = 'clicks'
GROUP BY 1),
chunk_constraint_count AS (
SELECT c.hypertable_id, cc.chunk_id, c.schema_name, c.table_name, count(*)
FROM _timescaledb_catalog.chunk_constraint cc
INNER JOIN _timescaledb_catalog.chunk c
	ON cc.chunk_id = c.id
GROUP BY 1, 2,3 ,4
)
SELECT ccc.chunk_id, tcc.dimension_slice_id, cc.constraint_name, null as hypertable_constraint_name
FROM information_schema.table_constraints tc
INNER JOIN chunk_constraint_count ccc 
ON ccc.schema_name = tc.table_schema
and ccc.table_name = tc.table_name
INNER JOIN dimension_count dc
ON dc.id = ccc.hypertable_id
INNER JOIN information_schema.check_constraints cc
ON tc.constraint_name = cc.constraint_name
INNER JOIN information_schema.check_constraints jcc
ON cc.check_clause = jcc.check_clause
AND jcc.constraint_name != cc.constraint_name
AND EXISTS (
	SELECT FROM _timescaledb_catalog.chunk_constraint
	WHERE chunk_constraint.constraint_name = jcc.constraint_name
)
left JOIN lateral (
	SELECT dimension_slice_id FROM _timescaledb_catalog.chunk_constraint
	WHERE chunk_constraint.constraint_name = jcc.constraint_name
	limit 1
) as tcc ON true
WHERE dc.count != ccc.count
and tc.constraint_name like 'constraint%'
and NOT EXISTS (
	SELECT FROM _timescaledb_catalog.chunk_constraint
	WHERE chunk_constraint.constraint_name = tc.constraint_name
	AND chunk_constraint.chunk_id = ccc.chunk_id
	AND chunk_constraint.hypertable_constraint_name IS NULL
);

@gugu
Copy link
Author

gugu commented Jun 7, 2024

┌──────────┬────────────────────┬─────────────────┬────────────────────────────┐
│ chunk_id │ dimension_slice_id │ constraint_name │ hypertable_constraint_name │
├──────────┼────────────────────┼─────────────────┼────────────────────────────┤
│     3786 │               2240 │ constraint_305  │ ∅                          │
│     3787 │               2241 │ constraint_303  │ ∅                          │
│     3788 │               2239 │ constraint_304  │ ∅                          │
│     3535 │               2240 │ constraint_305  │ ∅                          │
│     3127 │               2239 │ constraint_304  │ ∅                          │
│     3536 │               2241 │ constraint_303  │ ∅                          │
│     3537 │               2239 │ constraint_304  │ ∅                          │
│     3542 │               2239 │ constraint_304  │ ∅                          │
│     3543 │               2241 │ constraint_303  │ ∅                          │
│     3544 │               2240 │ constraint_305  │ ∅                          │
│     3613 │               2241 │ constraint_303  │ ∅                          │
│     3614 │               2239 │ constraint_304  │ ∅                          │
│     3568 │               2240 │ constraint_305  │ ∅                          │
│     3569 │               2239 │ constraint_304  │ ∅                          │
│     3570 │               2241 │ constraint_303  │ ∅                          │
│     3809 │               2241 │ constraint_303  │ ∅                          │
│     3810 │               2240 │ constraint_305  │ ∅                          │
│     3843 │               2239 │ constraint_304  │ ∅                          │
│     3615 │               2240 │ constraint_305  │ ∅                          │
│     3844 │               2240 │ constraint_305  │ ∅                          │
│     3811 │               2239 │ constraint_304  │ ∅                          │
│     3845 │               2241 │ constraint_303  │ ∅                          │
│     3672 │               2241 │ constraint_303  │ ∅                          │
│     3673 │               2240 │ constraint_305  │ ∅                          │
│     3674 │               2239 │ constraint_304  │ ∅                          │
│     3635 │               2240 │ constraint_305  │ ∅                          │
│     3636 │               2241 │ constraint_303  │ ∅                          │
│     3637 │               2239 │ constraint_304  │ ∅                          │
│     3910 │               2240 │ constraint_305  │ ∅                          │
│     3734 │               2241 │ constraint_303  │ ∅                          │
│     3735 │               2240 │ constraint_305  │ ∅                          │
│     3736 │               2239 │ constraint_304  │ ∅                          │
│     3740 │               2241 │ constraint_303  │ ∅                          │
│     3741 │               2240 │ constraint_305  │ ∅                          │
│     3742 │               2239 │ constraint_304  │ ∅                          │
│     3911 │               2241 │ constraint_303  │ ∅                          │
│     3912 │               2239 │ constraint_304  │ ∅                          │
│     3946 │               2241 │ constraint_303  │ ∅                          │
│     3947 │               2239 │ constraint_304  │ ∅                          │
│     3948 │               2240 │ constraint_305  │ ∅                          │
│     3760 │               2239 │ constraint_304  │ ∅                          │
│     3761 │               2241 │ constraint_303  │ ∅                          │
│     3762 │               2240 │ constraint_305  │ ∅                          │
│     3969 │               2240 │ constraint_305  │ ∅                          │
│     3970 │               2241 │ constraint_303  │ ∅                          │
│     3971 │               2239 │ constraint_304  │ ∅                          │
│     3975 │               2239 │ constraint_304  │ ∅                          │
│     3976 │               2241 │ constraint_303  │ ∅                          │
│     3977 │               2240 │ constraint_305  │ ∅                          │
│     4097 │               2240 │ constraint_305  │ ∅                          │
│     4098 │               2239 │ constraint_304  │ ∅                          │
│     4099 │               2241 │ constraint_303  │ ∅                          │
│     4103 │               2240 │ constraint_305  │ ∅                          │
│     4104 │               2241 │ constraint_303  │ ∅                          │
│     4105 │               2239 │ constraint_304  │ ∅                          │
│     4158 │               2241 │ constraint_303  │ ∅                          │
│     4159 │               2239 │ constraint_304  │ ∅                          │
│     4160 │               2240 │ constraint_305  │ ∅                          │
│     4181 │               2239 │ constraint_304  │ ∅                          │
│     4182 │               2240 │ constraint_305  │ ∅                          │
│     4183 │               2241 │ constraint_303  │ ∅                          │
│     3128 │               2240 │ constraint_305  │ ∅                          │
│     4221 │               2239 │ constraint_304  │ ∅                          │
│     4227 │               2241 │ constraint_303  │ ∅                          │
│     4222 │               2240 │ constraint_305  │ ∅                          │
│     4223 │               2241 │ constraint_303  │ ∅                          │
│     4228 │               2239 │ constraint_304  │ ∅                          │
│     4229 │               2240 │ constraint_305  │ ∅                          │
│     3129 │               2241 │ constraint_303  │ ∅                          │
│     3209 │               2241 │ constraint_303  │ ∅                          │
│     3210 │               2240 │ constraint_305  │ ∅                          │
│     3211 │               2239 │ constraint_304  │ ∅                          │
│     3215 │               2240 │ constraint_305  │ ∅                          │
│     3216 │               2241 │ constraint_303  │ ∅                          │
│     3217 │               2239 │ constraint_304  │ ∅                          │
│     3238 │               2240 │ constraint_305  │ ∅                          │
│     3239 │               2241 │ constraint_303  │ ∅                          │
│     3240 │               2239 │ constraint_304  │ ∅                          │
│     3277 │               2239 │ constraint_304  │ ∅                          │
│     3278 │               2240 │ constraint_305  │ ∅                          │
│     3279 │               2241 │ constraint_303  │ ∅                          │
│     3299 │               2241 │ constraint_303  │ ∅                          │
│     3300 │               2240 │ constraint_305  │ ∅                          │
│     3301 │               2239 │ constraint_304  │ ∅                          │
│     3302 │               2239 │ constraint_304  │ ∅                          │
│     3303 │               2241 │ constraint_303  │ ∅                          │
│     3304 │               2240 │ constraint_305  │ ∅                          │
│     3331 │               2239 │ constraint_304  │ ∅                          │
│     3332 │               2240 │ constraint_305  │ ∅                          │
│     3333 │               2241 │ constraint_303  │ ∅                          │
│     3371 │               2240 │ constraint_305  │ ∅                          │
│     3372 │               2241 │ constraint_303  │ ∅                          │
│     3373 │               2239 │ constraint_304  │ ∅                          │
│     3413 │               2241 │ constraint_303  │ ∅                          │
│     3414 │               2240 │ constraint_305  │ ∅                          │
│     3415 │               2239 │ constraint_304  │ ∅                          │
│     3419 │               2239 │ constraint_304  │ ∅                          │
│     3420 │               2241 │ constraint_303  │ ∅                          │
│     3421 │               2240 │ constraint_305  │ ∅                          │
│     3444 │               2240 │ constraint_305  │ ∅                          │
│     3445 │               2241 │ constraint_303  │ ∅                          │
│     3446 │               2239 │ constraint_304  │ ∅                          │
│     3452 │               2240 │ constraint_305  │ ∅                          │
│     3453 │               2241 │ constraint_303  │ ∅                          │
│     3454 │               2239 │ constraint_304  │ ∅                          │
│     3487 │               2240 │ constraint_305  │ ∅                          │
│     1793 │               2239 │ constraint_304  │ ∅                          │
│     1794 │               2240 │ constraint_305  │ ∅                          │
│     1795 │               2241 │ constraint_303  │ ∅                          │
│     3488 │               2241 │ constraint_303  │ ∅                          │
│     3489 │               2239 │ constraint_304  │ ∅                          │
│     1868 │               2240 │ constraint_305  │ ∅                          │
│     1869 │               2241 │ constraint_303  │ ∅                          │
│     1870 │               2239 │ constraint_304  │ ∅                          │
│     3513 │               2241 │ constraint_303  │ ∅                          │
│     3514 │               2239 │ constraint_304  │ ∅                          │
│     3515 │               2240 │ constraint_305  │ ∅                          │
│     1921 │               2239 │ constraint_304  │ ∅                          │
│     1922 │               2240 │ constraint_305  │ ∅                          │
│     1923 │               2241 │ constraint_303  │ ∅                          │
│     1978 │               2239 │ constraint_304  │ ∅                          │
│     1979 │               2240 │ constraint_305  │ ∅                          │
│     1980 │               2241 │ constraint_303  │ ∅                          │
│     2022 │               2239 │ constraint_304  │ ∅                          │
│     2023 │               2241 │ constraint_303  │ ∅                          │
│     2024 │               2240 │ constraint_305  │ ∅                          │
│     2049 │               2240 │ constraint_305  │ ∅                          │
│     2050 │               2241 │ constraint_303  │ ∅                          │
│     2051 │               2239 │ constraint_304  │ ∅                          │
│     2074 │               2240 │ constraint_305  │ ∅                          │
│     2075 │               2241 │ constraint_303  │ ∅                          │
│     2076 │               2239 │ constraint_304  │ ∅                          │
│     2077 │               2239 │ constraint_304  │ ∅                          │
│     2078 │               2241 │ constraint_303  │ ∅                          │
│     2229 │               2240 │ constraint_305  │ ∅                          │
│     2079 │               2240 │ constraint_305  │ ∅                          │
│     2084 │               2239 │ constraint_304  │ ∅                          │
│     2085 │               2241 │ constraint_303  │ ∅                          │
│     2086 │               2240 │ constraint_305  │ ∅                          │
│     2192 │               2240 │ constraint_305  │ ∅                          │
│     2193 │               2239 │ constraint_304  │ ∅                          │
│     2194 │               2241 │ constraint_303  │ ∅                          │
│     2228 │               2241 │ constraint_303  │ ∅                          │
│     2230 │               2239 │ constraint_304  │ ∅                          │
│     2251 │               2240 │ constraint_305  │ ∅                          │
│     2252 │               2239 │ constraint_304  │ ∅                          │
│     2253 │               2241 │ constraint_303  │ ∅                          │
│     2257 │               2240 │ constraint_305  │ ∅                          │
│     2258 │               2241 │ constraint_303  │ ∅                          │
│     2259 │               2239 │ constraint_304  │ ∅                          │
│     2280 │               2241 │ constraint_303  │ ∅                          │
│     2281 │               2239 │ constraint_304  │ ∅                          │
│     2282 │               2240 │ constraint_305  │ ∅                          │
│     2322 │               2241 │ constraint_303  │ ∅                          │
│     2323 │               2239 │ constraint_304  │ ∅                          │
│     2324 │               2240 │ constraint_305  │ ∅                          │
│     2397 │               2240 │ constraint_305  │ ∅                          │
│     2398 │               2239 │ constraint_304  │ ∅                          │
│     2399 │               2241 │ constraint_303  │ ∅                          │
│     2430 │               2241 │ constraint_303  │ ∅                          │
│     2431 │               2240 │ constraint_305  │ ∅                          │
│     2432 │               2239 │ constraint_304  │ ∅                          │
│     2459 │               2240 │ constraint_305  │ ∅                          │
│     2460 │               2239 │ constraint_304  │ ∅                          │
│     2461 │               2241 │ constraint_303  │ ∅                          │
│     2465 │               2240 │ constraint_305  │ ∅                          │
│     2466 │               2241 │ constraint_303  │ ∅                          │
│     2467 │               2239 │ constraint_304  │ ∅                          │
│     2488 │               2240 │ constraint_305  │ ∅                          │
│     2489 │               2239 │ constraint_304  │ ∅                          │
│     2490 │               2241 │ constraint_303  │ ∅                          │
│     2494 │               2239 │ constraint_304  │ ∅                          │
│     2495 │               2241 │ constraint_303  │ ∅                          │
│     2496 │               2240 │ constraint_305  │ ∅                          │
│     2518 │               2241 │ constraint_303  │ ∅                          │
│     2519 │               2240 │ constraint_305  │ ∅                          │
│     2520 │               2239 │ constraint_304  │ ∅                          │
│     2576 │               2241 │ constraint_303  │ ∅                          │
│     2577 │               2240 │ constraint_305  │ ∅                          │
│     2578 │               2239 │ constraint_304  │ ∅                          │
│     2628 │               2240 │ constraint_305  │ ∅                          │
│     2629 │               2241 │ constraint_303  │ ∅                          │
│     2630 │               2239 │ constraint_304  │ ∅                          │
│     2757 │               2240 │ constraint_305  │ ∅                          │
│     2758 │               2239 │ constraint_304  │ ∅                          │
│     2759 │               2241 │ constraint_303  │ ∅                          │
│     2780 │               2240 │ constraint_305  │ ∅                          │
│     2781 │               2239 │ constraint_304  │ ∅                          │
│     2782 │               2241 │ constraint_303  │ ∅                          │
│     2786 │               2240 │ constraint_305  │ ∅                          │
│     2787 │               2241 │ constraint_303  │ ∅                          │
│     2788 │               2239 │ constraint_304  │ ∅                          │
│     2840 │               2241 │ constraint_303  │ ∅                          │
│     2841 │               2239 │ constraint_304  │ ∅                          │
│     2842 │               2240 │ constraint_305  │ ∅                          │
│     2912 │               2241 │ constraint_303  │ ∅                          │
│     2913 │               2240 │ constraint_305  │ ∅                          │
│     2914 │               2239 │ constraint_304  │ ∅                          │
│     3016 │               2241 │ constraint_303  │ ∅                          │
│     3017 │               2240 │ constraint_305  │ ∅                          │
│     3018 │               2239 │ constraint_304  │ ∅                          │
│     3021 │               2239 │ constraint_304  │ ∅                          │
│     3022 │               2241 │ constraint_303  │ ∅                          │
│     3056 │               2241 │ constraint_303  │ ∅                          │
│     3023 │               2240 │ constraint_305  │ ∅                          │
│     3050 │               2239 │ constraint_304  │ ∅                          │
│     3051 │               2240 │ constraint_305  │ ∅                          │
│     3052 │               2241 │ constraint_303  │ ∅                          │
│     3057 │               2240 │ constraint_305  │ ∅                          │
│     3058 │               2239 │ constraint_304  │ ∅                          │
│     3111 │               2241 │ constraint_303  │ ∅                          │
│     3112 │               2240 │ constraint_305  │ ∅                          │
│     3113 │               2239 │ constraint_304  │ ∅                          │
└──────────┴────────────────────┴─────────────────┴────────────────────────────┘
(213 rows)

@antekresic
Copy link
Contributor

antekresic commented Jun 7, 2024

So it seems like we have a winner. That query should restore your corrupt catalog. You can attempt to fix it by running the following query.

BE ADVISED: keeping a fresh backup of the database would be ideal so you can revert back to it if the catalog is still corrupt after the attempted fix.

With that said, here is the query which should insert 213 catalog tuples exactly:

WITH dimension_count as (
SELECT ht.id, count(*)
FROM _timescaledb_catalog.hypertable ht
INNER JOIN _timescaledb_catalog.dimension d
	ON d.hypertable_id = ht.id
WHERE table_name = 'clicks'
GROUP BY 1),
chunk_constraint_count AS (
SELECT c.hypertable_id, cc.chunk_id, c.schema_name, c.table_name, count(*)
FROM _timescaledb_catalog.chunk_constraint cc
INNER JOIN _timescaledb_catalog.chunk c
	ON cc.chunk_id = c.id
GROUP BY 1, 2,3 ,4
)
INSERT INTO _timescaledb_catalog.chunk_constraint
SELECT ccc.chunk_id, tcc.dimension_slice_id, cc.constraint_name, null as hypertable_constraint_name
FROM information_schema.table_constraints tc
INNER JOIN chunk_constraint_count ccc 
ON ccc.schema_name = tc.table_schema
and ccc.table_name = tc.table_name
INNER JOIN dimension_count dc
ON dc.id = ccc.hypertable_id
INNER JOIN information_schema.check_constraints cc
ON tc.constraint_name = cc.constraint_name
INNER JOIN information_schema.check_constraints jcc
ON cc.check_clause = jcc.check_clause
AND jcc.constraint_name != cc.constraint_name
AND EXISTS (
	SELECT FROM _timescaledb_catalog.chunk_constraint
	WHERE chunk_constraint.constraint_name = jcc.constraint_name
)
left JOIN lateral (
	SELECT dimension_slice_id FROM _timescaledb_catalog.chunk_constraint
	WHERE chunk_constraint.constraint_name = jcc.constraint_name
	limit 1
) as tcc ON true
WHERE dc.count != ccc.count
and tc.constraint_name like 'constraint%'
and NOT EXISTS (
	SELECT FROM _timescaledb_catalog.chunk_constraint
	WHERE chunk_constraint.constraint_name = tc.constraint_name
	AND chunk_constraint.chunk_id = ccc.chunk_id
	AND chunk_constraint.hypertable_constraint_name IS NULL
);

Please let me know does it help.

Thanks!

fabriziomello added a commit to fabriziomello/timescaledb that referenced this issue Jun 7, 2024
This release contains performance improvements and bug fixes since
the 2.15.0 release. Best practice is to upgrade at the next
available opportunity.

**Migrating from self-hosted TimescaleDB v2.14.x and earlier**

After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [timescale#6797](timescale#6797).

If you are migrating from TimescaleDB v2.15.0 or v2.15.1, no changes are required.

**Bugfixes**
* timescale#6975: Fix sort pushdown for partially compressed chunks.
* timescale#6976: Fix removal of metadata function and update script.
* timescale#6978: Fix segfault in compress_chunk with primary space partition.
* timescale#6993: Disallow hash partitioning on primary column.

**Thanks**
* @gugu for reporting the issue with catalog corruption due to update.
* @srieding for reporting an issue with partially compressed chunks and ordering on joined columns.
fabriziomello added a commit that referenced this issue Jun 7, 2024
This release contains performance improvements and bug fixes since
the 2.15.0 release. Best practice is to upgrade at the next
available opportunity.

**Migrating from self-hosted TimescaleDB v2.14.x and earlier**

After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [#6797](#6797).

If you are migrating from TimescaleDB v2.15.0 or v2.15.1, no changes are required.

**Bugfixes**
* #6975: Fix sort pushdown for partially compressed chunks.
* #6976: Fix removal of metadata function and update script.
* #6978: Fix segfault in compress_chunk with primary space partition.
* #6993: Disallow hash partitioning on primary column.

**Thanks**
* @gugu for reporting the issue with catalog corruption due to update.
* @srieding for reporting an issue with partially compressed chunks and ordering on joined columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants