Database
A database is a collection of data gathered by users. Utilizing a storage-computing separation architecture, a database can be linked to a specific warehouse, similar to traditional Postgres databases, allowing users to add, delete, modify, and query data. A database can also function independently from a computing unit (Warehouse).
Primary methods for connecting a Database to a Warehouse:
- Creating a Database in the Warehouse using SQL commands (e.g., CREATE DATABASE xxx), which will display the new database information on the "Database" page of Data Cloud.
- Detaching the Database from the Warehouse results in a database that is independent of any Warehouse; it can later be reattached to the original or a different Warehouse.
- Backing up (Backup) and restoring (Restore) to a specific Warehouse.
Methods to detach a Database from a Warehouse:
- Deleting the Database in the Warehouse using SQL (e.g., DROP DATABASE xxx).
- Using the Detach operation to remove the Database from the Warehouse.
Note: Changes in the relationships between Database and Warehouse and updates to storage size may take several minutes to reflect.
Database Search
On the database page, the status of all databases in the current Data Cloud is displayed by default. Key information includes the database handle (Handle), the database name (DatabaseName) after appending the database and Warehouse, the binding status (Attached/Detached), and the storage size, among other current database operations. Additionally, the page shows the total storage size of the databases, the storage size for each state, and the storage size of databases bound to each Warehouse, as illustrated in the figure below:
The search box offers robust search functions, including:
- Fuzzy search: Enter a keyword (like "post") into the search box to display database entries that include the keyword in fields such as the database handle (Handle), Warehouse name (WarehouseName), database name (DatabaseName), and more.
- Exact match: The search box allows precise matching using "field name: field value". For instance:
- handle: Matches the handle field exactly, e.g., handle:postgres-9c1475d0
- DatabaseName: Matches the databaseName field exactly, e.g., DatabaseName:postgres
- warehouseId: Matches the warehouseId field exactly, e.g., warehouseId:wb3vlgqzev
- warehouseName: Matches the warehouseName field exactly, e.g., warehouseName:v_warehouse
- state: This field matches the state field, currently accepting values like attached and detached (other invalid values), e.g., state: attached.
Notes:
- Fuzzy searches and exact matches can be combined and separated by spaces.
- Multiple exact matches can also be combined and separated by spaces.
- When using multiple fuzzy search keywords, only results for the last keyword will be shown, and only the previous key's results will be displayed for multiple matches of the same key.
- All keys are case-insensitive, while all values (including fuzzy searches) are case-sensitive.
Database Management
We offer various database operations, including renaming the database handle (Handle), unbinding the Database and Warehouse (Detach), binding the Database and Warehouse (Attach), backing up the database (Backup), restoring the database (Restore), and deleting the Database (Drop).
- Rename: When creating a new database, the system generates a database handle, typically using the name as a prefix. Users can rename this handle to suit their preferences, but it must remain unique within the same Data Cloud. This renaming can be done for a single database or in batches for multiple databases.
- Detached: A connected Database can be detached from its Warehouse/database name as long as the Warehouse is in the "Running" state.
- Backup: If the warehouse is in the "Running" state, refer to the "Backup and Restore" page for more information.
- Restore: For more details, refer to the "Backup and Restore" page, as long as the restore target's Warehouse is in the "Running" state.
- Attached: You can attach a Database to a specific Warehouse, provided the Warehouse is in the "Running" state.
- Delete: Deleting a Database is the same as executing DROP DATABASE xxx, provided the Warehouse is in the "Running" state.
Access the Database details page to view comprehensive information and set the PITR time window, illustrated below:
Users can customize the time range on the storage page and observe the changes in the database storage size represented in a curve.