復制表
更新時間 2025-02-14 10:21:34
最近更新時間: 2025-02-14 10:21:34
分享文章
本頁介紹天翼云TeleDB數據庫的復制表功能。
復制表是所有DN 節點都存儲一份相同的數據。
teledb=# create table t_rep (id int,mc text) distribute by replication;
CREATE TABLE
teledb=# \d+ t_rep
Table "public.t_rep"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+----------+--------------+-------------
id | integer | | | | plain | |
mc | text | | | | extended | |
Distribute By: REPLICATION
Location Nodes: ALL DATANODES所有節點都會保存一份數據
teledb=# insert into t_rep values(1,'teledb'),(2,'ctyun');
\COPY 2
teledb=# EXECUTE DIRECT ON (dn01) 'select * from t_rep';
id | mc
----+---------
1 | teledb
2 | ctyun
(2 rows)
teledb=# EXECUTE DIRECT ON (dn02) 'select * from t_rep';
id | mc
----+---------
1 | teledb
2 | ctyun
(2 rows)