Change expected output for testcase 'tablesample'
authorPavan Deolasee <[email protected]>
Wed, 1 Jul 2015 09:52:49 +0000 (15:22 +0530)
committerPavan Deolasee <[email protected]>
Wed, 1 Jul 2015 09:52:49 +0000 (15:22 +0530)
Since table gets hash distributed to all datanodes, the sampling results vary
in XL. For a sufficiently large and well distributed table, sample count should
look fairly similar as compared to vanilla PostgreSQL. But since the test works
with a very small table, results look skewed in XL.

(The test still does not pass because the HINT returned by the datanode is not
returned to the frontend client and hence that shows up in the diff. But this
is a different bug and will be fixed separately)

src/test/regress/expected/tablesample.out

index 04e5eb8b807e2d1c95adae29a57e40742fe0ccf0..12987e0be3ff6869b663110b9fa5ac68e568f1d1 100644 (file)
@@ -3,22 +3,26 @@ INSERT INTO test_tablesample SELECT i, repeat(i::text, 200) FROM generate_series
 SELECT t.id FROM test_tablesample AS t TABLESAMPLE SYSTEM (50) REPEATABLE (10);
  id 
 ----
-  0
   1
   2
-  3
-  4
   5
+  6
+  8
   9
-(7 rows)
+  0
+  3
+  4
+  7
+(10 rows)
 
 SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (100.0/11) REPEATABLE (9999);
  id 
 ----
   6
-  7
   8
-(3 rows)
+  9
+  7
+(4 rows)
 
 SELECT count(*) FROM test_tablesample TABLESAMPLE SYSTEM (100);
  count 
@@ -29,31 +33,38 @@ SELECT count(*) FROM test_tablesample TABLESAMPLE SYSTEM (100);
 SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (100);
  id 
 ----
-  0
   1
   2
+  5
   6
-  7
   8
   9
-(7 rows)
+  0
+  3
+  4
+  7
+(10 rows)
 
 SELECT id FROM test_tablesample TABLESAMPLE BERNOULLI (50) REPEATABLE (100);
  id 
 ----
-  0
   1
+  2
+  6
+  8
+  9
+  0
   3
-  4
-  5
-(5 rows)
+  7
+(8 rows)
 
 SELECT id FROM test_tablesample TABLESAMPLE BERNOULLI (5.5) REPEATABLE (1);
  id 
 ----
+  1
+  9
   0
-  5
-(2 rows)
+(3 rows)
 
 CREATE VIEW test_tablesample_v1 AS SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (10*2) REPEATABLE (2);
 CREATE VIEW test_tablesample_v2 AS SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (99);
@@ -76,32 +87,35 @@ DECLARE tablesample_cur CURSOR FOR SELECT id FROM test_tablesample TABLESAMPLE S
 FETCH FIRST FROM tablesample_cur;
  id 
 ----
-  0
+  1
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  1
+  2
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  2
+  5
 (1 row)
 
 SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (10);
  id 
 ----
-  0
   1
   2
-  3
-  4
   5
+  6
+  8
   9
-(7 rows)
+  0
+  3
+  4
+  7
+(10 rows)
 
 FETCH NEXT FROM tablesample_cur;
  id 
@@ -112,31 +126,31 @@ FETCH NEXT FROM tablesample_cur;
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  7
+  8
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  8
+  9
 (1 row)
 
 FETCH FIRST FROM tablesample_cur;
  id 
 ----
-  0
+  1
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  1
+  2
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  2
+  5
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
@@ -148,28 +162,30 @@ FETCH NEXT FROM tablesample_cur;
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  7
+  8
 (1 row)
 
 FETCH NEXT FROM tablesample_cur;
  id 
 ----
-  8
+  9
 (1 row)
 
 CLOSE tablesample_cur;
 END;
 EXPLAIN SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (10);
-                                  QUERY PLAN                                   
--------------------------------------------------------------------------------
- Sample Scan (system) on test_tablesample  (cost=0.00..26.35 rows=635 width=4)
-(1 row)
+                                        QUERY PLAN                                        
+------------------------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)  (cost=0.00..26.35 rows=635 width=4)
+   ->  Sample Scan (system) on test_tablesample  (cost=0.00..26.35 rows=635 width=4)
+(2 rows)
 
 EXPLAIN SELECT * FROM test_tablesample_v1;
-                                  QUERY PLAN                                   
--------------------------------------------------------------------------------
- Sample Scan (system) on test_tablesample  (cost=0.00..10.54 rows=254 width=4)
-(1 row)
+                                        QUERY PLAN                                        
+------------------------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)  (cost=0.00..10.54 rows=254 width=4)
+   ->  Sample Scan (system) on test_tablesample  (cost=0.00..10.54 rows=254 width=4)
+(2 rows)
 
 -- errors
 SELECT id FROM test_tablesample TABLESAMPLE FOOBAR (1);