Debian Codegraph @

src/test/isolation/specs/index-only-scan.spec

raw
1 # index-only scan test
2 #
3 # This test tries to expose problems with the interaction between index-only
4 # scans and SSI.
5 #
6 # Any overlap between the transactions must cause a serialization failure.
7
8 setup
9 {
10 CREATE TABLE tabx (id int NOT NULL);
11 INSERT INTO tabx SELECT generate_series(1,10000);
12 ALTER TABLE tabx ADD PRIMARY KEY (id);
13 CREATE TABLE taby (id int NOT NULL);
14 INSERT INTO taby SELECT generate_series(1,10000);
15 ALTER TABLE taby ADD PRIMARY KEY (id);
16 }
17 setup { VACUUM FREEZE ANALYZE tabx; }
18 setup { VACUUM FREEZE ANALYZE taby; }
19
20 teardown
21 {
22 DROP TABLE tabx;
23 DROP TABLE taby;
24 }
25
26 session s1
27 setup
28 {
29 BEGIN ISOLATION LEVEL SERIALIZABLE;
30 SET LOCAL seq_page_cost = 0.1;
31 SET LOCAL random_page_cost = 0.1;
32 SET LOCAL cpu_tuple_cost = 0.03;
33 }
34 step rxwy1 { DELETE FROM taby WHERE id = (SELECT min(id) FROM tabx); }
35 step c1 { COMMIT; }
36
37 session s2
38 setup
39 {
40 BEGIN ISOLATION LEVEL SERIALIZABLE;
41 SET LOCAL seq_page_cost = 0.1;
42 SET LOCAL random_page_cost = 0.1;
43 SET LOCAL cpu_tuple_cost = 0.03;
44 }
45 step rywx2 { DELETE FROM tabx WHERE id = (SELECT min(id) FROM taby); }
46 step c2 { COMMIT; }