This paper introduces the operation of managing data tables on PolarDB-X 1.0 console.
Prerequisites
Function introduction
Adjust shard keysIn a PolarDB-X 1.0 instance, the sharding method of a logical table is defined jointly by a sharding function and a shard key. The sharding function contains the number of shards to be created and the routing algorithm. The shard key also specifies the MySQL data type of the shard key. You can consider that the database sharding and table sharding methods of a logical table in PolarDB-X 1.0 are the same, only when they use the same sharding function and shard key. The same sharding method enables PolarDB-X 1.0 to locate a unique physical database shard and physical table shard based on the value of the shard key. If the database sharding and table sharding methods of a logical table are different and an SQL query does not contain both the database shard key and the table shard key, PolarDB-X 1.0 scans all database shards or all table shards when it processes the SQL query.
Disable full table scanBy default, PolarDB-X 1.0 enables the full table scan feature for newly created tables. However, frequent use of the full table scan feature consumes database resources and reduces query efficiency. PolarDB-X 1.0 supports manually disable full table scan in the console.
Query table schemaYou can manage tables in the PolarDB-X 1.0 console and view table schema details.
Delete tablesTables cannot be directly deleted in the PolarDB-X 1.0 console. You can log on to a database and use SQL statements to delete tables. For more information, see Connect to database and Basic SQL operations.
Enter the data tables interface
Adjust shard keys
Disable full table scan
- The target table must have a specified shard key. For more information about how to set a shard key, see Adjust shard keys.
- If the full table scan feature is not enabled for a PolarDB-X 1.0 table shard, you must include the shard key in the WHERE clause to access the table. Otherwise, PolarDB-X 1.0 will return the TDDL-4510 error code.
Query table schema
On the tables page, find the target table and click View Table Schema in the Actions column. In the dialog box that appears, you can view table schema details, such as the column name, data type, and whether a column is a primary key.
