-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DOC-539] [2024.2] [EA] Colocated tables with tablespaces #24704
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for infallible-bardeen-164bc9 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
``` | ||
|
||
### Backup and restore colocated tables using ysql_dump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Backup and restore colocated tables using ysql_dump | |
### Backup and restore colocated Database using ysql_dump |
ALTER TABLE ALL IN TABLESPACE tablespace_1 COLOCATED WITH table1 SET TABLESPACE tablespace_2 CASCADE; | ||
``` | ||
|
||
This command will move only the tables present in `tablespace_1` that are colocated with `table1`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command will move only the tables present in `tablespace_1` that are colocated with `table1`. | |
This command will move only the relations present in `tablespace_1` that are colocated with `table1`. |
|
||
- Moving non-colocated tables: For non-colocated tables, use the previously mentioned syntax to [alter the tablespace of a non-colocated table](#create-a-colocated-table-with-tablespace). | ||
|
||
- Moving colocated tables: To move colocated tables, use the following variant of the previously mentioned command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Moving colocated tables: To move colocated tables, use the following variant of the previously mentioned command: | |
- Moving colocated relations: To move colocated relations, use the following variant of the previously mentioned command: |
ALTER TABLE ALL IN TABLESPACE pg_default COLOCATED WITH table1 SET TABLESPACE new_tablespace CASCADE; | ||
``` | ||
|
||
This command moves all restored colocated tables that are colocated with `table1` to `new_tablespace`. Note that the `pg_default` tablespace is the default tablespace in YugabyteDB, and all tables are restored to this default if the `--use_tablespaces` option is not provided during backup and restore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command moves all restored colocated tables that are colocated with `table1` to `new_tablespace`. Note that the `pg_default` tablespace is the default tablespace in YugabyteDB, and all tables are restored to this default if the `--use_tablespaces` option is not provided during backup and restore. | |
This command moves all restored colocated relations that are colocated with `table1` to `new_tablespace`. Note that the `pg_default` tablespace is the default tablespace in YugabyteDB, and all relations are restored to this default if the `--use_tablespaces` option is not provided during backup and restore. |
@netlify /preview/explore/colocation/#colocated-tables-with-tablespaces