创建列存储引擎插件
使用列存储表之前,需要创建extension,插件创建完成之后,可以在 pg_extension 系统表中看到新增的插件条目
teledb=# CREATE EXTENSION pax;
CREATE EXTENSION
teledb=# select * from pg_extension;
extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
--------------+----------+--------------+----------------+------------+-----------+--------------
plpgsql | 10 | 11 | f | 1.0 | |
teledbx_core | 10 | 2200 | t | 1.0 | |
pax | 10 | 11 | f | 1.0 | |
(3 rows)
teledb=# \dx
List of installed extensions
Name | Version | Schema | Description
--------------+---------+------------+------------------------------
pax | 1.0 | pg_catalog | pax access method
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
teledbx_core | 1.0 | public | core module of teledbx
(3 rows)
查看系统表列存储引擎新增条目
创建列存储插件引擎后,在pg_am 系统表中看到新增的表访问方式,在 pg_namespace 系统表中看到新增的辅助表命名空间
teledb=# select oid, * from pg_am;
oid | amname | amhandler | amtype
-------+--------+--------------------------------+--------
403 | btree | bthandler | i
405 | hash | hashhandler | i
783 | gist | gisthandler | i
2742 | gin | ginhandler | i
4000 | spgist | spghandler | i
3580 | brin | brinhandler | i
2 | heap | heap_tableam_handler | t
16396 | pax | pg_ext_aux.pax_tableam_handler | t
(8 rows)
teledb=# select oid, * from pg_namespace;
oid | nspname | nspowner | nspacl
-------+--------------------+----------+-------------------------------------------
99 | pg_toast | 10 |
5500 | pg_oracle | 10 |
7094 | pg_ext_aux | 10 |
11952 | pg_temp_1 | 10 |
11953 | pg_toast_temp_1 | 10 |
11 | pg_catalog | 10 | {teledb=UC/teledb,=U/teledb}
2200 | public | 10 | {teledb=UC/teledb,=UC/teledb}
13117 | information_schema | 10 | {teledb=UC/teledb,=U/teledb}
(8 rows)
删除列存储引擎插件
teledb=# DROP EXTENSION pax;
DROP EXTENSION
teledb=# \dx
List of installed extensions
Name | Version | Schema | Description
--------------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
teledbx_core | 1.0 | public | core module of teledbx
(2 rows)