only_index
[plantuner.git] / expected / plantuner.out
1 LOAD 'plantuner';
2 SHOW    plantuner.disable_index;
3  plantuner.disable_index 
4 -------------------------
5  
6 (1 row)
7
8 CREATE TABLE wow (i int, j int);
9 CREATE INDEX i_idx ON wow (i);
10 CREATE INDEX j_idx ON wow (j);
11 CREATE INDEX i1 ON WOW (i);
12 CREATE INDEX i2 ON WOW (i);
13 CREATE INDEX i3 ON WOW (i);
14 SET enable_seqscan=off;
15 SELECT * FROM wow;
16  i | j 
17 ---+---
18 (0 rows)
19
20 SET plantuner.disable_index="i_idx, j_idx";
21 SELECT * FROM wow;
22  i | j 
23 ---+---
24 (0 rows)
25
26 SHOW plantuner.disable_index;
27   plantuner.disable_index   
28 ----------------------------
29  public.i_idx, public.j_idx
30 (1 row)
31
32 SET plantuner.disable_index="i_idx, nonexistent, public.j_idx, wow";
33 WARNING:  'nonexistent' does not exist
34 WARNING:  'wow' is not an index
35 SHOW plantuner.disable_index;
36   plantuner.disable_index   
37 ----------------------------
38  public.i_idx, public.j_idx
39 (1 row)
40
41 SET plantuner.enable_index="i_idx";
42 SHOW plantuner.enable_index;
43  plantuner.enable_index 
44 ------------------------
45  public.i_idx
46 (1 row)
47
48 SELECT * FROM wow;
49  i | j 
50 ---+---
51 (0 rows)
52
53 --test only index
54 RESET plantuner.disable_index;
55 RESET plantuner.enable_index;
56 SET enable_seqscan=off;
57 SET enable_bitmapscan=off;
58 SET enable_indexonlyscan=off;
59 SET plantuner.only_index="i1";
60 SHOW plantuner.only_index;
61  plantuner.only_index 
62 ----------------------
63  public.i1
64 (1 row)
65
66 EXPLAIN (COSTS OFF) SELECT * FROM wow WHERE i = 0;
67          QUERY PLAN         
68 ----------------------------
69  Index Scan using i1 on wow
70    Index Cond: (i = 0)
71 (2 rows)
72
73 SET plantuner.disable_index="i1,i2,i3";
74 EXPLAIN (COSTS OFF) SELECT * FROM wow WHERE i = 0;
75          QUERY PLAN         
76 ----------------------------
77  Index Scan using i1 on wow
78    Index Cond: (i = 0)
79 (2 rows)
80
81 SET plantuner.only_index="i2";
82 EXPLAIN (COSTS OFF) SELECT * FROM wow WHERE i = 0;
83          QUERY PLAN         
84 ----------------------------
85  Index Scan using i2 on wow
86    Index Cond: (i = 0)
87 (2 rows)
88
89 RESET plantuner.only_index;
90 EXPLAIN (COSTS OFF) SELECT * FROM wow WHERE i = 0;
91           QUERY PLAN           
92 -------------------------------
93  Index Scan using i_idx on wow
94    Index Cond: (i = 0)
95 (2 rows)
96