summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-04-21 22:11:35 +0000
committerTomas Vondra2017-04-21 22:11:35 +0000
commit0e071bd0938a3118ec7deaddeb7170ddb43baa8b (patch)
tree5847d8987d6773450e00002e409393030db3dd58
parentd507faf6eaf54b7706cbcd2ef173c604efc268c7 (diff)
Resolve failures in tablesample regression test suite
Expected query results are adopted from XL 9.5, and seem to be quite stable. Removed part of expected results which comes from upstream, but from a later commit.
-rw-r--r--src/test/regress/expected/tablesample.out104
1 files changed, 18 insertions, 86 deletions
diff --git a/src/test/regress/expected/tablesample.out b/src/test/regress/expected/tablesample.out
index 35fd45379b..e1429d6da1 100644
--- a/src/test/regress/expected/tablesample.out
+++ b/src/test/regress/expected/tablesample.out
@@ -5,13 +5,11 @@ INSERT INTO test_tablesample
SELECT t.id FROM test_tablesample AS t TABLESAMPLE SYSTEM (50) REPEATABLE (0);
id
----
- 3
- 4
- 5
6
- 7
8
-(6 rows)
+ 9
+ 7
+(4 rows)
SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (100.0/11) REPEATABLE (0);
id
@@ -21,28 +19,23 @@ SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (100.0/11) REPEATABLE (0);
SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (0);
id
----
- 3
- 4
- 5
6
8
-(6 rows)
+ 9
+ 7
+(4 rows)
SELECT id FROM test_tablesample TABLESAMPLE BERNOULLI (50) REPEATABLE (0);
id
----
- 4
- 5
- 6
- 7
8
-(5 rows)
+ 9
+(2 rows)
SELECT id FROM test_tablesample TABLESAMPLE BERNOULLI (5.5) REPEATABLE (0);
id
----
- 7
-(1 row)
+(0 rows)
-- 100% should give repeatable count results (ie, all rows) in any case
SELECT count(*) FROM test_tablesample TABLESAMPLE SYSTEM (100);
@@ -92,31 +85,29 @@ DECLARE tablesample_cur CURSOR FOR
FETCH FIRST FROM tablesample_cur;
id
----
- 3
+ 6
(1 row)
FETCH NEXT FROM tablesample_cur;
id
----
- 4
+ 8
(1 row)
FETCH NEXT FROM tablesample_cur;
id
----
- 5
+ 9
(1 row)
SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (0);
id
----
- 3
- 4
- 5
6
- 7
8
-(6 rows)
+ 9
+ 7
+(4 rows)
FETCH NEXT FROM tablesample_cur;
id
@@ -137,19 +128,19 @@ FETCH NEXT FROM tablesample_cur;
FETCH FIRST FROM tablesample_cur;
id
----
- 3
+ 6
(1 row)
FETCH NEXT FROM tablesample_cur;
id
----
- 4
+ 8
(1 row)
FETCH NEXT FROM tablesample_cur;
id
----
- 5
+ 9
(1 row)
FETCH NEXT FROM tablesample_cur;
@@ -234,65 +225,6 @@ select * from
pct | count
-----+-------
0 | 0
- 100 | 10000
-(2 rows)
-
-select * from
- (values (0),(100)) v(pct),
- lateral (select count(*) from tenk1 tablesample system (pct)) ss;
- pct | count
------+-------
- 0 | 0
- 100 | 10000
-(2 rows)
-
-explain (costs off)
-select pct, count(unique1) from
- (values (0),(100)) v(pct),
- lateral (select * from tenk1 tablesample bernoulli (pct)) ss
- group by pct;
- QUERY PLAN
---------------------------------------------------------
- HashAggregate
- Group Key: "*VALUES*".column1
- -> Nested Loop
- -> Values Scan on "*VALUES*"
- -> Sample Scan on tenk1
- Sampling: bernoulli ("*VALUES*".column1)
-(6 rows)
-
-select pct, count(unique1) from
- (values (0),(100)) v(pct),
- lateral (select * from tenk1 tablesample bernoulli (pct)) ss
- group by pct;
- pct | count
------+-------
- 100 | 10000
-(1 row)
-
-select pct, count(unique1) from
- (values (0),(100)) v(pct),
- lateral (select * from tenk1 tablesample system (pct)) ss
- group by pct;
- pct | count
------+-------
- 100 | 10000
-(1 row)
-
--- check that collations get assigned within the tablesample arguments
-SELECT count(*) FROM test_tablesample TABLESAMPLE bernoulli (('1'::text < '0'::text)::int);
- count
--------
- 0
-(1 row)
-
--- check behavior during rescans, as well as correct handling of min/max pct
-select * from
- (values (0),(100)) v(pct),
- lateral (select count(*) from tenk1 tablesample bernoulli (pct)) ss;
- pct | count
------+-------
- 0 | 0
100 | 0
(2 rows)