1 SET client_min_messages = warning;
3 RESET client_min_messages;
4 CREATE TABLE gevelt ( t box );
5 \copy gevelt from 'data/rect.data'
6 SELECT center(t) AS p INTO gevelp FROM gevelt;
7 CREATE INDEX gist_idx ON gevelt USING gist ( t );
8 CREATE INDEX spgist_idx ON gevelp USING spgist ( p );
9 CREATE INDEX kdspgist_idx ON gevelp USING spgist ( p kd_point_ops);
11 SELECT gist_stat('gist_idx');
13 -----------------------------------------
16 Number of leaf pages: 28 +
17 Number of tuples: 3406 +
18 Number of invalid tuples: 0 +
19 Number of leaf tuples: 3378 +
20 Total size of tuples: 143516 bytes+
21 Total size of leaf tuples: 142296 bytes+
22 Total size of index: 237568 bytes+
26 SELECT gist_tree('gist_idx');
28 -----------------------------------------------------------------------------------------------
29 0(l:0) blk: 0 numTuple: 28 free: 6940b(14.95%) rightlink:4294967295 (InvalidBlockNumber) +
30 1(l:1) blk: 2 numTuple: 278 free: 2588b(68.28%) rightlink:4294967295 (InvalidBlockNumber)+
31 2(l:1) blk: 18 numTuple: 123 free: 2736b(66.47%) rightlink:3 (OK) +
32 3(l:1) blk: 8 numTuple: 128 free: 2516b(69.17%) rightlink:21 (OK) +
33 4(l:1) blk: 4 numTuple: 92 free: 4100b(49.75%) rightlink:23 (OK) +
34 5(l:1) blk: 19 numTuple: 122 free: 2780b(65.93%) rightlink:7 (OK) +
35 6(l:1) blk: 15 numTuple: 135 free: 2208b(72.94%) rightlink:11 (OK) +
36 7(l:1) blk: 23 numTuple: 126 free: 2604b(68.09%) rightlink:8 (OK) +
37 8(l:1) blk: 10 numTuple: 156 free: 1284b(84.26%) rightlink:18 (OK) +
38 9(l:1) blk: 13 numTuple: 130 free: 2428b(70.25%) rightlink:19 (OK) +
39 10(l:1) blk: 9 numTuple: 124 free: 2692b(67.01%) rightlink:24 (OK) +
40 11(l:1) blk: 12 numTuple: 70 free: 5068b(37.89%) rightlink:25 (OK) +
41 12(l:1) blk: 21 numTuple: 112 free: 3220b(60.54%) rightlink:10 (OK) +
42 13(l:1) blk: 16 numTuple: 89 free: 4232b(48.14%) rightlink:26 (OK) +
43 14(l:1) blk: 26 numTuple: 108 free: 3396b(58.38%) rightlink:5 (OK) +
44 15(l:1) blk: 7 numTuple: 99 free: 3792b(53.53%) rightlink:16 (OK) +
45 16(l:1) blk: 6 numTuple: 85 free: 4408b(45.98%) rightlink:22 (OK) +
46 17(l:1) blk: 14 numTuple: 163 free: 976b(88.04%) rightlink:6 (OK) +
47 18(l:1) blk: 28 numTuple: 122 free: 2780b(65.93%) rightlink:12 (OK) +
48 19(l:1) blk: 3 numTuple: 57 free: 5640b(30.88%) rightlink:27 (OK) +
49 20(l:1) blk: 24 numTuple: 80 free: 4628b(43.28%) rightlink:15 (OK) +
50 21(l:1) blk: 17 numTuple: 89 free: 4232b(48.14%) rightlink:4 (OK) +
51 22(l:1) blk: 20 numTuple: 166 free: 844b(89.66%) rightlink:13 (OK) +
52 23(l:1) blk: 27 numTuple: 122 free: 2780b(65.93%) rightlink:14 (OK) +
53 24(l:1) blk: 22 numTuple: 147 free: 1680b(79.41%) rightlink:9 (OK) +
54 25(l:1) blk: 11 numTuple: 146 free: 1724b(78.87%) rightlink:2 (OK) +
55 26(l:1) blk: 5 numTuple: 61 free: 5464b(33.04%) rightlink:28 (OK) +
56 27(l:1) blk: 1 numTuple: 92 free: 4100b(49.75%) rightlink:20 (OK) +
57 28(l:1) blk: 25 numTuple: 156 free: 1284b(84.26%) rightlink:17 (OK) +
61 SELECT * FROM gist_print('gist_idx') as t(level int, valid bool, a box) where level=1;
63 -------+-------+-----------------------------
65 1 | t | (32261,50040),(20397,42779)
66 1 | t | (20400,41715),(9175,31485)
67 1 | t | (8924,39250),(3,31083)
68 1 | t | (20594,19151),(10869,10535)
69 1 | t | (49999,42533),(43290,27088)
70 1 | t | (8993,50012),(64,39781)
71 1 | t | (32394,42395),(20513,31557)
72 1 | t | (20715,10161),(10407,51)
73 1 | t | (42941,36244),(32606,27088)
74 1 | t | (32512,16364),(20947,11843)
75 1 | t | (20327,49975),(9216,42130)
76 1 | t | (13397,31188),(7334,19288)
77 1 | t | (20856,31294),(13642,19263)
78 1 | t | (6986,30859),(107,19466)
79 1 | t | (39187,26879),(32770,15690)
80 1 | t | (49985,15380),(42047,43)
81 1 | t | (32715,11509),(24675,6)
82 1 | t | (41916,5154),(32914,357)
83 1 | t | (43056,42360),(32661,36457)
84 1 | t | (32544,31262),(21146,25161)
85 1 | t | (10104,18999),(15,7761)
86 1 | t | (41835,15495),(32828,5360)
87 1 | t | (49944,26858),(39348,15728)
88 1 | t | (50027,50073),(32453,42694)
89 1 | t | (24423,11473),(20828,181)
90 1 | t | (10146,7495),(138,81)
91 1 | t | (32705,25105),(20838,16626)
95 SELECT spgist_stat('spgist_idx');
97 ----------------------------------
103 usedSpace: 126.70 kbytes+
104 freeSpace: 40.64 kbytes +
109 leafPlaceholders: 569 +
110 innerPlaceholders: 0 +
115 SELECT * FROM spgist_print('kdspgist_idx') as t(tid tid, node_n int, level int, tid_pointer tid, prefix float8, node_label int, leaf_value point);
116 tid | node_n | level | tid_pointer | prefix | node_label | leaf_value
117 ----------+--------+-------+-------------+--------+------------+-------------------
118 (1,1) | 0 | 1 | (5,1) | | |
119 (1,1) | 1 | 1 | (5,2) | | |
120 (5,2) | 0 | 2 | (5,6) | | |
121 (5,2) | 1 | 2 | (5,3) | | |
122 (5,3) | 0 | 3 | (5,5) | | |
123 (5,3) | 1 | 3 | (5,12) | | |
124 (5,12) | 0 | 4 | (5,13) | | |
125 (5,12) | 1 | 4 | (14,226) | | |
126 (14,226) | | 5 | | | | (43240,47256.5)
127 (5,13) | 0 | 5 | (3,112) | | |
128 (5,13) | 1 | 5 | (5,25) | | |
129 (5,25) | 0 | 6 | (22,116) | | |
130 (5,25) | 1 | 6 | (22,115) | | |
131 (22,115) | | 7 | | | | (30902,44532)
132 (22,116) | | 7 | | | | (23048,47416)
133 (3,112) | | 6 | | | | (35218.5,42124)
134 (5,5) | 0 | 4 | (5,11) | | |
135 (5,5) | 1 | 4 | (5,22) | | |
136 (5,22) | 0 | 5 | (20,225) | | |
137 (5,22) | 1 | 5 | (5,23) | | |
138 (5,23) | 0 | 6 | (9,112) | | |
139 (5,23) | 1 | 6 | (9,114) | | |
140 (9,114) | | 7 | | | | (44732,32182)
141 (9,112) | | 7 | | | | (35580,33526.5)
142 (20,225) | | 6 | | | | (47724.5,27185.5)
143 (5,11) | 0 | 5 | (13,101) | | |
144 (5,11) | 1 | 5 | (13,100) | | |
145 (13,100) | | 6 | | | | (24069,30850.5)
146 (13,101) | | 6 | | | | (29539,25566)
147 (5,6) | 0 | 3 | (5,7) | | |
148 (5,6) | 1 | 3 | (5,19) | | |
149 (5,19) | 0 | 4 | (5,20) | | |
150 (5,19) | 1 | 4 | (18,225) | | |
151 (18,225) | | 5 | | | | (20920.5,49105.5)
152 (5,20) | 0 | 5 | (10,110) | | |
153 (5,20) | 1 | 5 | (10,113) | | |
154 (10,113) | | 6 | | | | (93,46797)
155 (10,110) | | 6 | | | | (28.5,38640.5)
156 (5,7) | 0 | 4 | (7,113) | | |
157 (5,7) | 1 | 4 | (5,21) | | |
158 (5,21) | 0 | 5 | (19,115) | | |
159 (5,21) | 1 | 5 | (19,112) | | |
160 (19,112) | | 6 | | | | (11916.5,31668)
161 (19,115) | | 6 | | | | (20622.5,27462.5)
162 (7,113) | | 5 | | | | (9296,35157)
163 (5,1) | 0 | 2 | (5,8) | | |
164 (5,1) | 1 | 2 | (5,4) | | |
165 (5,4) | 0 | 3 | (5,10) | | |
166 (5,4) | 1 | 3 | (5,14) | | |
167 (5,14) | 0 | 4 | (5,15) | | |
168 (5,14) | 1 | 4 | (15,222) | | |
169 (15,222) | | 5 | | | | (41926.5,17934.5)
170 (5,15) | 0 | 5 | (8,113) | | |
171 (5,15) | 1 | 5 | (8,112) | | |
172 (8,112) | | 6 | | | | (32425,20702.5)
173 (8,113) | | 6 | | | | (29134,15559.5)
174 (5,10) | 0 | 4 | (12,94) | | |
175 (5,10) | 1 | 4 | (5,24) | | |
176 (5,24) | 0 | 5 | (21,108) | | |
177 (5,24) | 1 | 5 | (21,107) | | |
178 (21,107) | | 6 | | | | (49822.5,7097.5)
179 (21,108) | | 6 | | | | (40315.5,1689.5)
180 (12,94) | | 5 | | | | (30295.5,5090)
181 (5,8) | 0 | 3 | (5,17) | | |
182 (5,8) | 1 | 3 | (5,9) | | |
183 (5,9) | 0 | 4 | (6,114) | | |
184 (5,9) | 1 | 4 | (5,16) | | |
185 (5,16) | 0 | 5 | (16,123) | | |
186 (5,16) | 1 | 5 | (16,127) | | |
187 (16,127) | | 6 | | | | (18352.5,19366)
188 (16,123) | | 6 | | | | (24795,14921)
189 (6,114) | | 5 | | | | (6706,16676)
190 (5,17) | 0 | 4 | (5,18) | | |
191 (5,17) | 1 | 4 | (17,226) | | |
192 (17,226) | | 5 | | | | (23690,10214.5)
193 (5,18) | 0 | 5 | (11,113) | | |
194 (5,18) | 1 | 5 | (11,109) | | |
195 (11,109) | | 6 | | | | (5501.5,9916)
196 (11,113) | | 6 | | | | (1072.5,4752)
199 SELECT * FROM spgist_print('spgist_idx') as t(tid tid, node_n int, level int, tid_pointer tid, prefix point, node_label int, leaf_value point) WHERE level = 1;
200 tid | node_n | level | tid_pointer | prefix | node_label | leaf_value
201 -------+--------+-------+-------------+-------------------------------------+------------+------------
202 (1,1) | 0 | 1 | (5,4) | (24530.2070484581,23595.7092511013) | |
203 (1,1) | 1 | 1 | (5,3) | (24530.2070484581,23595.7092511013) | |
204 (1,1) | 2 | 1 | (5,2) | (24530.2070484581,23595.7092511013) | |
205 (1,1) | 3 | 1 | (5,1) | (24530.2070484581,23595.7092511013) | |
209 CREATE TABLE test__int( a int[] );
210 \copy test__int from 'data/test__int.data'
211 CREATE INDEX gin_idx ON test__int USING gin ( a );
212 INSERT INTO test__int ( SELECT ARRAY[t] || '{1000}'::_int4 FROM generate_series (1,300) as t );
213 INSERT INTO test__int ( SELECT ARRAY[t] || '{1001}'::_int4 FROM generate_series (1,300) as t, generate_series(1,12) );
214 VACUUM ANALYZE test__int;
215 SELECT * FROM gin_stat('gin_idx') as t(value int, nrow int);