-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#12186] YSQL: Disable hash partitioned index syntax for colocated in…
…dexes and tablegroup indexes Summary: This diff explicitly disables the syntax to create a hash partitioned colocated index/tablegroup index. Consider two examples below: ``` CREATE TABLEGROUP tbl_group; CREATE TABLE tbl(h1 int, h2 int, r1 int, r2 int) TABLEGROUP tbl_group; CREATE INDEX idx ON tbl(h1 hash); CREATE INDEX idx2 on tbl((h1, h2) hash); \d tbl Table "public.tbl" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------- h1 | integer | | | h2 | integer | | | r1 | integer | | | r2 | integer | | | Indexes: "idx" lsm (h1 HASH), tablegroup "tbl_group" "idx2" lsm ((h1, h2) HASH), tablegroup "tbl_group" Tablegroup: "tbl_group" ``` ``` CREATE DATABASE colocation_test colocated = true; \c colocation_test CREATE TABLE tbl (h1 int, h2 int, r1 int, r2 int); CREATE INDEX idx on tbl (h1 hash); CREATE INDEX idx2 on tbl ((h1, h2) hash); \d tbl Table "public.tbl" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------- h1 | integer | | | h2 | integer | | | r1 | integer | | | r2 | integer | | | Indexes: "idx" lsm (h1 HASH) "idx2" lsm ((h1, h2) HASH) \c yugabyte DROP DATABASE colocation_test; ``` The PG table descriptions of all colocated/tablegroup indexes created in these two examples are hash-partitioned. However, in reality, all colocated/tablegroup indexes created in these two examples are range-partitioned. The reason is we allow specifying hash columns for colocated/tablegroup indexes, and on CatalogManager side, we change all hash columns to range columns in `CreateTableRequestPB` in `CreateTable()`. On Postgre's side, `index_create()` inserts an index tuple with the specified HASH index option into `pg_index`. Test Plan: ybd --java-test org.yb.pgsql.TestPgRegressTablegroup ybd --java-test org.yb.pgsql.TestPgRegressColocation Reviewers: mihnea, tverona, alex Reviewed By: alex Subscribers: bogdan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D16702
- Loading branch information
Showing
6 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters