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

[DOC-539] [2024.2] [EA] Colocated tables with tablespaces #24704

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aishwarya24
Copy link
Collaborator

@netlify /preview/explore/colocation/#colocated-tables-with-tablespaces

@aishwarya24 aishwarya24 added the area/documentation Documentation needed label Oct 29, 2024
@aishwarya24 aishwarya24 self-assigned this Oct 29, 2024
Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for infallible-bardeen-164bc9 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c4b37a2
🔍 Latest deploy log https://app.netlify.com/sites/infallible-bardeen-164bc9/deploys/6721349f80709b0008f04fef
😎 Deploy Preview https://deploy-preview-24704--infallible-bardeen-164bc9.netlify.app/preview/explore/colocation/#colocated-tables-with-tablespaces
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


```

### Backup and restore colocated tables using ysql_dump
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Documentation needed
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants