yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.91k stars 1.06k forks source link

[Phase 3][colocation] Allow tables to use hash keys #3361

Open jaki opened 4 years ago

jaki commented 4 years ago

Jira Link: [DB-368] Currently, colocated tables are forced to use range keys. (As expected, opted out tables are not under this restriction.) Rather, colocated tables should default to using range keys (see issue #3034), but they should not be restricted to this. Remove the restriction.

To clarify, this issue tracks removing the restriction; issue #3034 tracks setting the default.

jaki commented 4 years ago

To give an example,

CREATE TABLE t (i int, PRIMARY KEY (i HASH));

should be allowed but is currently not.

jaki commented 3 years ago

Interestingly, CREATE INDEX ON t (i HASH) currently works.