Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e1d7017

Browse files
ildusvbwagner
authored andcommitted
Refactor plantuner, fix valgrind errors, also fix possible errors in Oid lists
1 parent 604f820 commit e1d7017

File tree

3 files changed

+201
-147
lines changed

3 files changed

+201
-147
lines changed

contrib/plantuner/expected/plantuner.out

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
LOAD 'plantuner';
2+
SET enable_seqscan=off;
23
SHOW plantuner.disable_index;
34
plantuner.disable_index
45
-------------------------
56

67
(1 row)
78

89
CREATE TABLE wow (i int, j int);
10+
INSERT INTO wow SELECT a, a+ 1 FROM generate_series(1, 1000) a;
911
CREATE INDEX i_idx ON wow (i);
1012
CREATE INDEX j_idx ON wow (j);
11-
SET enable_seqscan=off;
12-
SELECT * FROM wow;
13-
i | j
14-
---+---
15-
(0 rows)
13+
EXPLAIN (COSTS OFF) SELECT count(*) FROM wow;
14+
QUERY PLAN
15+
----------------------------------------
16+
Aggregate
17+
-> Bitmap Heap Scan on wow
18+
-> Bitmap Index Scan on j_idx
19+
(3 rows)
20+
21+
SELECT count(*) FROM wow;
22+
count
23+
-------
24+
1000
25+
(1 row)
1626

1727
SET plantuner.disable_index="i_idx, j_idx";
18-
SELECT * FROM wow;
19-
i | j
20-
---+---
21-
(0 rows)
28+
EXPLAIN (COSTS OFF) SELECT count(*) FROM wow;
29+
QUERY PLAN
30+
-----------------------
31+
Aggregate
32+
-> Seq Scan on wow
33+
(2 rows)
34+
35+
SELECT count(*) FROM wow;
36+
count
37+
-------
38+
1000
39+
(1 row)
2240

2341
SHOW plantuner.disable_index;
2442
plantuner.disable_index
@@ -42,8 +60,38 @@ SHOW plantuner.enable_index;
4260
public.i_idx
4361
(1 row)
4462

45-
SELECT * FROM wow;
46-
i | j
47-
---+---
48-
(0 rows)
63+
EXPLAIN (COSTS OFF) SELECT count(*) FROM wow;
64+
QUERY PLAN
65+
----------------------------------------
66+
Aggregate
67+
-> Bitmap Heap Scan on wow
68+
-> Bitmap Index Scan on i_idx
69+
(3 rows)
70+
71+
SELECT count(*) FROM wow;
72+
count
73+
-------
74+
1000
75+
(1 row)
76+
77+
DROP INDEX j_idx;
78+
SELECT pg_reload_conf();
79+
pg_reload_conf
80+
----------------
81+
t
82+
(1 row)
83+
84+
EXPLAIN (COSTS OFF) SELECT count(*) FROM wow;
85+
QUERY PLAN
86+
----------------------------------------
87+
Aggregate
88+
-> Bitmap Heap Scan on wow
89+
-> Bitmap Index Scan on i_idx
90+
(3 rows)
91+
92+
SELECT count(*) FROM wow;
93+
count
94+
-------
95+
1000
96+
(1 row)
4997

0 commit comments

Comments
 (0)