agg 执行聚集函数
setop 处理包含集合操作的查询
1 关键技术实验
1.1
create database hcie with OWNER test ENCODING='UTF-8' DBCOMPATIBILITY='MYSQL';
create table hcie.tenk1(
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
hcie=> \copy tenk1 from '/home/omm/tenk.csv' with (format 'csv',delimiter
',',ignore_extra_data 'true',encoding 'utf8');
hcie=> create index tenk1_unique1 on tenk1 using btree(unique1 int4_ops);
hcie=> create index tenk1_unique2 on tenk1 using btree(unique2 int4_ops);
hcie=> create index tenk1_hundred on tenk1 using btree(hundred int4_ops);
analyze tenk1;
数据倾斜率
hcie=> select * from pgxc_get_table_skewness;
schemaname | tablename | totalsize | avgsize | maxratio | minratio | skewsize |
skewratio | skewstddev
------------+-----------+-----------+---------+----------+----------+----------
+-----------+------------
hcie | tenk1 | 2932736 | 977579 | .338 | .330 | 24576 |
.008 | 12513
(1 row)
hcie=> select * from pgxc_class;
pcrelid | pclocatortype | pchashalgorithm | pchashbuckets | pgroup |
redistributed | redis_order | pcattnum | nodeoids | opt
ions
---------+---------------+-----------------+---------------+----------------
+---------------+-------------+----------+-------------------+----
-----
33925 | H | 1 | 4096 | group_version1 | n
| 1024 | 1 | 16384 16389 16392 |
(1 row)
hcie=> SELECT a.count,b.node_name
FROM
(SELECT count(*) AS count,xc_node_id FROM tenk1 GROUP BY xc_node_id) a,
文档被以下合辑收录
评论