Setting Up a Storage Engine
The storage engine has a great impact on the overall efficiency and performance of the database. Select a proper storage engine based on the actual requirements. You can run WITH ( [ORIENTATION | STORAGE_TYPE] [= value] [, ... ] ) to specify an optional storage parameter for a table or index. The parameters are described as follows.
ORIENTATION |
STORAGE_TYPE |
ROW (default value): The data will be stored in rows. |
[USTORE (default value)|ASTORE|Null] |
If ORIENTATION is set to ROW and STORAGE_TYPE is left empty, the type of the created table is determined by the value of the enable_default_ustore_table parameter. The parameter value can be on or off. The default value is on. If this parameter is set to off, an Astore table is created.
Example:
gaussdb=# CREATE TABLE TEST(a int); gaussdb=# \d+ test Table "public.test" Column | Type | Modifiers | Storage | Stats target | Description --------+---------+-----------+---------+--------------+------------- a | integer | | plain | | Has OIDs: no Options: orientation=row, compression=no, storage_type=USTORE gaussdb=# CREATE TABLE TEST1(a int) with(orientation=row, storage_type=ustore); gaussdb=# \d+ test1 Table "public.test1" Column | Type | Modifiers | Storage | Stats target | Description --------+---------+-----------+---------+--------------+------------- a | integer | | plain | | Has OIDs: no Options: orientation=row, storage_type=ustore, compression=no gaussdb=# CREATE TABLE TEST2(a int) with(orientation=row, storage_type=astore); gaussdb=# \d+ test2 Table "public.test2" Column | Type | Modifiers | Storage | Stats target | Description --------+---------+-----------+---------+--------------+------------- a | integer | | plain | | Has OIDs: no Options: orientation=row, storage_type=astore, compression=no gaussdb=# create table test4(a int) with(orientation=row); gaussdb=# \d+ List of relations Schema | Name | Type | Owner | Size | Storage | Description --------+-------+-------+-----------+---------+------------------------------------------------------+------------- public | test4 | table | l30048445 | 0 bytes | {orientation=row,compression=no,storage_type=USTORE} | (1 row) gaussdb=# show enable_default_ustore_table; enable_default_ustore_table ----------------------------- on (1 row)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.