mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
contrib/tsm_system_rows
This commit is contained in:
14
contrib/tsm_system_rows/sql/tsm_system_rows.sql
Normal file
14
contrib/tsm_system_rows/sql/tsm_system_rows.sql
Normal file
@ -0,0 +1,14 @@
|
||||
CREATE EXTENSION tsm_system_rows;
|
||||
|
||||
CREATE TABLE test_tablesample (id int, name text) WITH (fillfactor=10); -- force smaller pages so we don't have to load too much data to get multiple pages
|
||||
|
||||
INSERT INTO test_tablesample SELECT i, repeat(i::text, 1000) FROM generate_series(0, 30) s(i) ORDER BY i;
|
||||
ANALYZE test_tablesample;
|
||||
|
||||
SELECT count(*) FROM test_tablesample TABLESAMPLE system_rows (1000);
|
||||
SELECT id FROM test_tablesample TABLESAMPLE system_rows (8) REPEATABLE (5432);
|
||||
|
||||
EXPLAIN SELECT id FROM test_tablesample TABLESAMPLE system_rows (20) REPEATABLE (10);
|
||||
|
||||
-- done
|
||||
DROP TABLE test_tablesample CASCADE;
|
Reference in New Issue
Block a user