You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describing a colocated Materialized View (\d materialized_view_name) does not show colocation information. When describing a colocated table a "Colocation: true" row is displayed.
Steps to reproduce:
CREATE DATABASE colodb WITH colocation = true;
\c colodb
CREATE TABLE x (a INT);
CREATE MATERIALIZED VIEW m1 AS SELECT * FROM x;
\d x
\d m1
Warning: Please confirm that this issue does not contain any sensitive information
I confirm this issue does not contain any sensitive information.
The text was updated successfully, but these errors were encountered:
… colocation information
Summary:
We can specify the colocation of a materialized view using the with (colocation = true/false) clause
Eg:
CREATE MATERIALIZED VIEW m1 with (colocation = true) AS SELECT * from t1; [Creates colocated Mat. view]
CREATE MATERIALIZED VIEW m2 with (colocation = false) AS SELECT * from t1; [Creates non-colocated Mat. view]
CREATE MATERIALIZED VIEW m3 AS SELECT * from t1; [Creates colocated Mat. view]
By default colocation is true.
There was an issue with describe that it didnt show colocation info of a materialized view, have fixed that by including Materialized View as a supported relation kind for colocation in add_colocation_footer which is called while preparing result of the \d command
Running \d m1 (where m1 is a colocated Mat. view) before change produces the following output:
Materialized view "public.m1"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | integer | | |
This is unlike executing it on a colocated table which produces an extra row "Colocation: true"
After changes the output is:
Materialized view "public.m1"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | integer | | |
Colocation: true
Test Plan:
./yb_build.sh --java-test org.yb.pgsql.TestPgRegressColocation#testPgRegressColocation
Checked tablet-ids of colocated and non-colocated materialized view on yb-ctl cluster
Reviewers: skumar, tverona, yguan, fizaa
Reviewed By: yguan, fizaa
Subscribers: ksreenivasan, yql
Differential Revision: https://phabricator.dev.yugabyte.com/D24206
Jira Link: DB-6369
Description
Describing a colocated Materialized View (\d materialized_view_name) does not show colocation information. When describing a colocated table a "Colocation: true" row is displayed.
Steps to reproduce:
CREATE DATABASE colodb WITH colocation = true;
\c colodb
CREATE TABLE x (a INT);
CREATE MATERIALIZED VIEW m1 AS SELECT * FROM x;
\d x
\d m1
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: