File tree 3 files changed +79
-0
lines changed
3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ Parsed test spec with 3 sessions
2
+
3
+ starting permutation: noseq prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
4
+ step noseq: SET enable_seqscan = false;
5
+ step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
6
+ step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
7
+ step begin: BEGIN;
8
+ step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx;
9
+ QUERY PLAN
10
+
11
+ Sort
12
+ Sort Key: id
13
+ -> Index Scan using test_dc_data on test_dc
14
+ Index Cond: (data = 34)
15
+ step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq;
16
+ QUERY PLAN
17
+
18
+ Sort
19
+ Sort Key: id, data
20
+ -> Seq Scan on test_dc
21
+ Filter: ((data)::text = '34'::text)
22
+ step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
23
+ id data
24
+
25
+ 34 34
26
+ step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...>
27
+ step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100);
28
+ step end2: COMMIT;
29
+ step selecti: EXECUTE getrow_idx;
30
+ id data
31
+
32
+ 34 34
33
+ 134 34
34
+ step selects: EXECUTE getrow_seq;
35
+ id data
36
+
37
+ 34 34
38
+ 134 34
39
+ step end: COMMIT;
40
+ step drop: <... completed>
Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ test: fk-contention
14
14
test: fk-deadlock
15
15
test: fk-deadlock2
16
16
test: eval-plan-qual
17
+ test: drop-index-concurrently-1
Original file line number Diff line number Diff line change
1
+ # DROP INDEX CONCURRENTLY
2
+ #
3
+ # This test shows that the concurrent write behaviour works correctly
4
+ # with the expected output being 2 rows.
5
+ #
6
+ setup
7
+ {
8
+ CREATE TABLE test_dc ( id serial primary key , data int ) ;
9
+ INSERT INTO test_dc ( data ) SELECT * FROM generate_series ( 1 , 100 ) ;
10
+ CREATE INDEX test_dc_data ON test_dc ( data ) ;
11
+ }
12
+
13
+ teardown
14
+ {
15
+ DROP TABLE test_dc ;
16
+ }
17
+
18
+ session "s1"
19
+ step "noseq" { SET enable_seqscan = false ; }
20
+ step "prepi" { PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data = 34 ORDER BY id , data ; }
21
+ step "preps" { PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data ::text = 34 ::text ORDER BY id , data ; }
22
+ step "begin" { BEGIN ; }
23
+ step "explaini" { EXPLAIN ( COSTS OFF ) EXECUTE getrow_idx ; }
24
+ step "explains" { EXPLAIN ( COSTS OFF ) EXECUTE getrow_seq ; }
25
+ step "selecti" { EXECUTE getrow_idx ; }
26
+ step "selects" { EXECUTE getrow_seq ; }
27
+ step "end" { COMMIT ; }
28
+
29
+ session "s2"
30
+ setup { BEGIN; }
31
+ step "select2" { SELECT * FROM test_dc WHERE data = 34 ORDER BY id , data ; }
32
+ step "insert2" { INSERT INTO test_dc ( data ) SELECT * FROM generate_series ( 1 , 100 ) ; }
33
+ step "end2" { COMMIT ; }
34
+
35
+ session "s3"
36
+ step "drop" { DROP INDEX CONCURRENTLY test_dc_data ; }
37
+
38
+ permutation "noseq" "prepi" "preps" "begin" "explaini" "explains" "select2" "drop" "insert2" "end2" "selecti" "selects" "end"
You can’t perform that action at this time.
0 commit comments