VastbaseE100

基于开源技术的HTAP数据库管理系统。性能优异,稳定可靠,提供诸多专属领域特性。

Menu

兼容SAMPLE抽样采集语法

atlasdb=# CREATE TABLE test_sample (id int, name text) WITH (fillfactor=10);
CREATE TABLE
atlasdb=# 
atlasdb=# INSERT INTO test_sample
atlasdb-#   SELECT i, repeat(i::text, 200) FROM generate_series(0, 9) s(i);
INSERT 0 10
atlasdb=# SELECT t.id FROM test_sample AS t SAMPLE BLOCK (50) SEED (0);
 id 
----
  0
  1
  2
  3
  4
  5
  6
  7
  8
(9 rows)

atlasdb=# SELECT id FROM test_sample SAMPLE BLOCK (100.0/11) SEED (0);
 id 
----
(0 rows)

atlasdb=# SELECT id FROM test_sample SAMPLE BLOCK (50) SEED (0);
 id 
----
  3
  4
  5
  9
(4 rows)

atlasdb=# SELECT id FROM test_sample SAMPLE (50) SEED (0);
 id 
----
  0
  1
  2
  4
  7
  9
(6 rows)

atlasdb=# SELECT id FROM test_sample SAMPLE (5.5) SEED (0);
 id 
----
(0 rows)