Skip to content

Commit

Permalink
Fix for inconsistent num_chunks
Browse files Browse the repository at this point in the history
Different num_chunks values reported by
timescaledb_information.hypertables and
timescaledb_information.chunks.
View definition of hypertables was
not filtering dropped and osm_chunks.

Fixes #5338
  • Loading branch information
shhnwz committed Feb 26, 2023
1 parent 152ef02 commit 98cc457
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ accidentally triggering the load of a previous DB version.**
## Unreleased

**Bugfixes**
* #5364 Fix num_chunks inconsistency in hypertables view
* #5336 Use NameData and namestrcpy for names
* #5317 Fix some incorrect memory handling

Expand Down
2 changes: 1 addition & 1 deletion sql/views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SELECT ht.schema_name AS hypertable_schema,
(
SELECT count(1)
FROM _timescaledb_catalog.chunk ch
WHERE ch.hypertable_id = ht.id) AS num_chunks,
WHERE ch.hypertable_id = ht.id AND ch.dropped IS FALSE AND ch.osm_chunk IS FALSE) AS num_chunks,
(
CASE WHEN compression_state = 1 THEN
TRUE
Expand Down

0 comments on commit 98cc457

Please sign in to comment.