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

Add support for USING INDEX TABLESPACE #8323

Closed
deeps1991 opened this issue May 6, 2021 · 0 comments
Closed

Add support for USING INDEX TABLESPACE #8323

deeps1991 opened this issue May 6, 2021 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)

Comments

@deeps1991
Copy link
Contributor

deeps1991 commented May 6, 2021

Today, there is no way to set tablespace for Unique indexes:

yugabyte=# CREATE TABLE mytable (id int, UNIQUE(id) USING INDEX TABLESPACE mytablespace);
ERROR:  USING INDEX TABLESPACE not supported yet
LINE 1: CREATE TABLE mytable (id int, UNIQUE(id) USING INDEX TABLESP...
                                                 ^
HINT:  See https://github.com/YugaByte/yugabyte-db/issues/1129. Click '+' on the description to raise its priority

Note that this should still not be allowed for primary key index, which is an intrinsic part of the table itself, and should never be associated with a tablespace different from the indexed table.

@deeps1991 deeps1991 self-assigned this May 6, 2021
@deeps1991 deeps1991 added the area/ysql Yugabyte SQL (YSQL) label May 6, 2021
deeps1991 added a commit that referenced this issue Jul 13, 2021
Summary:
Added support for the "USING INDEX TABLESPACE" clause. This will
allow setting tablespace for unique indexes. However, since the primary
key index is an intrinsic part of the table itself, it cannot have
a separate tablespace (it should have the same tablespace as that of
the table). Thus we throw a syntax error if there is an attempt to set
tablespace for a primary key index using the "USING INDEX TABLESPACE"
clause.

Test Plan:
ybd --scb --sj --java-test org.yb.pgsql.TestTablespaceProperties
ybd --scb --sj --java-test org.yb.pgsql.TestPgRegressTablespaces

Reviewers: mihnea

Reviewed By: mihnea

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D11533
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

2 participants