云数据库 GaussDB-设置存储引擎
设置存储引擎
存储引擎会对数据库整体效率和性能存在巨大影响,请根据实际需求选择适当的存储引擎。用户可使用WITH ( [ORIENTATION | STORAGE_TYPE] [= value] [, ... ] )为表或索引指定一个可选的存储参数。参数的详细描述如下所示:
ORIENTATION |
STORAGE_TYPE |
ROW(缺省值):表的数据将以行式存储。 |
[USTORE(缺省值)|ASTORE|空] |
如果ORIENTATION指定为ROW,且STORAGE_TYPE为空的情况下创建出的表类型取决于GUC参数enable_default_ustore_table(取值为on/off,默认情况为on):如果参数设置为on,创建出的表为Ustore类型;如果为off,创建出的表为Astore类型。
具体示例如下:
gaussdb=# CREATE TABLE TEST(a int);gaussdb=# \d+ test Table "public.test" Column | Type | Modifiers | Storage | Stats target | Description--------+---------+-----------+---------+--------------+------------- a | integer | | plain | |Has OIDs: noOptions: orientation=row, compression=no, storage_type=USTORE, segment=offgaussdb=# CREATE TABLE TEST1(a int) with(orientation=row, storage_type=ustore);gaussdb=# \d+ test1Table "public.test1" Column | Type | Modifiers | Storage | Stats target | Description--------+---------+-----------+---------+--------------+------------- a | integer | | plain | |Has OIDs: noOptions: orientation=row, storage_type=ustore, compression=no, segment=offgaussdb=# CREATE TABLE TEST2(a int) with(orientation=row, storage_type=astore);gaussdb=# \d+ test2Table "public.test2" Column | Type | Modifiers | Storage | Stats target | Description--------+---------+-----------+---------+--------------+------------- a | integer | | plain | |Has OIDs: noOptions: orientation=row, storage_type=astore, compression=nogaussdb=# CREATE TABLE test4(a int) with(orientation=row);gaussdb=# \d+ List of relations Schema | Name | Type | Owner | Size | Storage | Description--------+-------+-------+-----------+---------+------------------------------------------------------------------+------------- public | test | table | z7ee88f3a | 0 bytes | {orientation=row,compression=no,storage_type=USTORE,segment=off} | public | test1 | table | z7ee88f3a | 0 bytes | {orientation=row,storage_type=ustore,compression=no,segment=off} | public | test2 | table | z7ee88f3a | 0 bytes | {orientation=row,storage_type=astore,compression=no} | public | test3 | table | z7ee88f3a | 16 kB | {orientation=column,storage_type=astore,compression=low} | public | test4 | table | z7ee88f3a | 0 bytes | {orientation=row,compression=no,storage_type=USTORE,segment=off} |(5 rows)gaussdb=# show enable_default_ustore_table; enable_default_ustore_table----------------------------- on(1 row)gaussdb=# DROP TABLE test;gaussdb=# DROP TABLE test1;gaussdb=# DROP TABLE test2;gaussdb=# DROP TABLE test4;
- 大数据存储_OBS怎么设置_免费的对象存储
- 权限管理能力_怎么设置权限_云容器引擎
- GaussDB学习_gaussdb教程_高斯数据库学习_华为云
- GaussDB数据库安全_GaussDB收费吗_高斯数据库安全
- GaussDB培训_GaussDB教程_高斯数据库培训-华为云
- GaussDB配额_GaussDB数据库配额_高斯数据库配额_华为云
- 云数据库 RDS 的实例存储类型有哪些
- GaussDB设置默认值_GaussDB存储过程_高斯数据库设置默认值-华为云
- GaussDB用法_GaussDB数据库使用方法_高斯数据库如何使用_华为云
- GaussDB学习_gaussdb数据库_高斯数据库学习_华为云