File: sampling_pushdown.test_slow

package info (click to toggle)
duckdb 1.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 564
file content (44 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# name: test/optimizer/sampling_pushdown.test_slow
# description: Test the performance of Sampling Pushdown optimization
# group: [optimizer]

require tpch

statement ok
CALL DBGEN(sf=0.1);

# tablesample system + seq scan becomes sample scan
query II
EXPLAIN ANALYZE SELECT count(*) FROM lineitem tablesample system(0.1%)
----
analyzed_plan	<REGEX>:.*TABLE_SCAN.*System: 0.1%.*

# using sample system + seq scan becomes sample scan
query II
EXPLAIN ANALYZE SELECT count(*) FROM lineitem using sample system(0.1%)
----
analyzed_plan	<REGEX>:.*TABLE_SCAN.*System: 0.1%.*

# tablesample system + seq scan with join becomes sample scan with join
query II
EXPLAIN ANALYZE SELECT count(*) FROM lineitem tablesample system(0.1%), orders tablesample system(0.1%)
----
analyzed_plan	<REGEX>:.*TABLE_SCAN.*System: 0.1%.*

# tablesample bernoulli: no pushdown
query II
EXPLAIN ANALYZE SELECT count(*) FROM lineitem tablesample bernoulli(0.1%)
----
analyzed_plan	<REGEX>:.*Bernoulli.*TABLE_SCAN.*

# tablesample reservoir: no pushdown
query II
EXPLAIN ANALYZE SELECT count(*) FROM lineitem tablesample reservoir(0.1%)
----
analyzed_plan	<REGEX>:.*RESERVOIR_SAMPLE.*TABLE_SCAN.*

# tablesample system after a derived table: no pushdown
query II
EXPLAIN ANALYZE SELECT count(*) FROM lineitem, orders where l_orderkey = o_orderkey USING SAMPLE SYSTEM(25%)
----
analyzed_plan	<REGEX>:.*System.*TABLE_SCAN.*