Database Objects
Naming Rules
Rule 1: The object name cannot be duplicated with any keyword of the database.
Rule 2: Object names (including database names, table names, field names, and index names) must be in lowercase and separated by underscores (_).
Rule 3: The length of an object name (including the database name, table name, field name, and index name) cannot exceed 30 characters.
Rule 4: The table alias must be short. Generally, aliases are in lowercase letters.
Table Design Rules
Rule 1: Compatibility must be considered during table design.
Columns can be added but cannot be deleted.
Rule 2: The table name and database name cannot exceed 48 bytes.
Rule 3: By default, tables are created based on the optimal performance specifications. If the high-performance table is not required, you can set performance parameter Z00_THROUGHPUT to big, medium, or small when creating a table. By default, this parameter is not set to big. If you use RocksDB as the storage engine, memory needs to be allocated in advance and the number of tables created in an instance is limited. For details, see What Should I Pay Attention to When Creating a GeminiDB Cassandra Table?.
If necessary, use denormalization and redundancy to improve the read performance.
Indexing Rules
Rule 1: Design all queries as primary-key based queries and do not rely too much on secondary indexes.
Rule 2: An index can be used for query only after it is configured.
Rule 3: Do not frequently update indexes.
Rule 4: Do not create an index column for a table that contains too many duplicate values. For example, if one table stores 100 million data records and one of its columns contains the same data or a few types data, creating an index column for this table is not recommended.
Rule 5: The counter column cannot be indexed.
Rule 6: Do not create an index for any column that is frequently updated or deleted.
Rule 7: Use indexes together with partition keys to minimize message forwarding between nodes and resource consumption and prevent out-of-memory or high CPU usage.
View Rules
- If a materialized view is used, ensure that the original table corresponds to no more than three views. The more views the original table corresponds to, the greater impacts on the synchronization of views.
- Do not use any frequently-updated field in the original table as the primary key of a view.
Flow Table Rules
One flow table stores 24 hours of data by default. If there is a large amount of data to be queried, return results on multiple pages. No more than 100 query results are returned each time and a retry is allowed if a query request times out.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.