timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.93k stars 882 forks source link

Add aliases for compression functions and views #7443

Open mkindahl opened 1 week ago

mkindahl commented 1 week ago

This adds a set of aliases for existing compression functions and view to better reflect the column store capabilities of compressed hypertables. Note that there are no changes to the old interface at all, it remains the same.

The procedures convert_to_rowstore and convert_to_columnstore are added as aliases to decompress_chunk and compress_chunk respectively. We change these from functions to procedures to be able to split the conversion into multiple transactions and avoid heavy locking for longer periods.

The function add_columnstore_policy and remove_columnstore_policy are added as an alias for add_compression_policy and remove_compression_policy respectively.

The functions hypertable_columnstore_stats and chunk_columnstore_stats are added as aliases for hypertable_compression_stats and chunk_compression_stats respectively.

The views hypertable_columnstore_settings, chunk_columnstore_settings, and columnstore_settings are added as aliases for the corresponding views.

We also add aliases for parameters to functions and procedures that take these.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.11%. Comparing base (59f50f2) to head (b49fbb0). Report is 619 commits behind head on main.

Files with missing lines Patch % Lines
src/with_clause_parser.c 87.50% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7443 +/- ## ========================================== + Coverage 80.06% 82.11% +2.04% ========================================== Files 190 230 +40 Lines 37181 43087 +5906 Branches 9450 10833 +1383 ========================================== + Hits 29770 35380 +5610 - Misses 2997 3377 +380 + Partials 4414 4330 -84 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

mkindahl commented 3 days ago

This now contains the changes mentioned in the document. There is an ongoing discussion about creating aliases for compress_orderby and compress_segmentby and use just orderby and segmentby.

mkindahl commented 2 days ago

Thank you @mkindahl, the changes align to what has been proposed on the PRD.

As discussed, I am in favor of also aliasing some of the params. For example the following ones:

      timescaledb.compress,
      timescaledb.compress_segmentby 
      timescaledb.compress_orderby 

Added aliases for the above parameters. They are visible in the added test. Please take a look and see if you're fine with it.

iroussos commented 1 day ago

Thank you @mkindahl, the decision to switch to using procedures looks good to me and the rationale discussed on the slack thread for why we should do so makes total sense to me. I can not see any blockers from a product perspective to not follow this path.

As the PR is the single source of truth for the changes, do you mind also adding a summary on this on the description of the PR so that it is clear here as well for people that do not follow the slack thread? Thank you!

mkindahl commented 1 day ago

Thank you @mkindahl, the decision to switch to using procedures looks good to me and the rationale discussed on the slack thread for why we should do so makes total sense to me. I can not see any blockers from a product perspective to not follow this path.

As the PR is the single source of truth for the changes, do you mind also adding a summary on this on the description of the PR so that it is clear here as well for people that do not follow the slack thread? Thank you!

Thank you @iroussos. Once I merge the commits into a single commit I will create a proper message for the commit and the pull request with a more elaborate description.