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

[Enhancement]: Extend enabling compression on a continuous aggregrate with 'segmentby' and 'orderby' parameters #5161

Closed
emizero opened this issue Jan 9, 2023 · 1 comment
Assignees
Labels
enhancement An enhancement to an existing feature for functionality

Comments

@emizero
Copy link

emizero commented Jan 9, 2023

What type of enhancement is this?

API improvement, Performance

What subsystems and features will be improved?

Compression, Continuous aggregate

What does the enhancement do?

Extend "ALTER MATERIALIZED VIEW" with the 'segmentby' and 'orderby' parameters when enabling compression.
segmentby parameter is crucial for performance when caggs are especially large. At the moment trying the query results in the error below.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);
ERROR:  unrecognized parameter "timescaledb.compress_segmentby"

Currently, there is a workaround that allows us to enable compression directly on the internal hypertable for the continuous aggregate.

ALTER TABLE _timescaledb_internal._materialized_hypertable_71 SET (                              
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);
ALTER TABLE

Implementation challenges

Unknown at the moment

@emizero emizero added the enhancement An enhancement to an existing feature for functionality label Jan 9, 2023
@kgyrtkirk kgyrtkirk self-assigned this Jan 30, 2023
@kgyrtkirk
Copy link
Contributor

@fabriziomello: it would probably make sense to cover all options in the compression with clause here; however that raises the question - does all of them make sense for an MV as well?

If they do make sense - then I would probably need to add some end-markers to CompressHypertableOption and ContinuousAggViewOption enums.

kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 10, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 10, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 10, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
kgyrtkirk added a commit to kgyrtkirk/timescaledb that referenced this issue Feb 13, 2023
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes timescale#5161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to an existing feature for functionality
Projects
None yet
Development

No branches or pull requests

2 participants