forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5d9f146
committed
What looks like some *major* improvements to btree indexing...
Patches from: aoki@CS.Berkeley.EDU (Paul M. Aoki)i gave jolly my btree bulkload code a long, long time ago but nevergave him a bunch of my bugfixes. here's a diff against the 6.0baseline.for some reason, this code has slowed down somewhat relative to theinsertion-build code on very small tables. don't know why -- it usedto be within about 10%. anyway, here are some (highly unscientific!)timings on a dec 3000/300 for synthetic tables with 10k, 100k and1000k tuples (basically, 1mb, 10mb and 100mb heaps). 'c' meansclustered (pre-sorted) inputs and 'u' means unclustered (randomlyordered) inputs. the 10k table basically fits in the buffer pool, butthe 100k and 1000k tables don't. as you can see, insertion build isfine if you've sorted your heaps on your index key or if your heapfits in core, but is absolutely horrible on unordered data (yes,that's 7.5 hours to index 100mb of data...) because of the zillions ofrandom i/os.if it doesn't work for you for whatever reason, you can always turn itback off by flipping the FastBuild flag in nbtree.c. i don't havetime to maintain it.good luck!baseline code:time psql -c 'create index c10 on k10 using btree (c int4_ops)' bttestreal 8.6time psql -c 'create index u10 on k10 using btree (b int4_ops)' bttestreal 9.1time psql -c 'create index c100 on k100 using btree (c int4_ops)' bttestreal 59.2time psql -c 'create index u100 on k100 using btree (b int4_ops)' bttestreal 652.4time psql -c 'create index c1000 on k1000 using btree (c int4_ops)' bttestreal 636.1time psql -c 'create index u1000 on k1000 using btree (b int4_ops)' bttestreal 26772.9bulkloading code:time psql -c 'create index c10 on k10 using btree (c int4_ops)' bttestreal 11.3time psql -c 'create index u10 on k10 using btree (b int4_ops)' bttestreal 10.4time psql -c 'create index c100 on k100 using btree (c int4_ops)' bttestreal 59.5time psql -c 'create index u100 on k100 using btree (b int4_ops)' bttestreal 63.5time psql -c 'create index c1000 on k1000 using btree (c int4_ops)' bttestreal 636.9time psql -c 'create index u1000 on k1000 using btree (b int4_ops)' bttestreal 701.01 parentd5a3f52 commit5d9f146
File tree
4 files changed
+388
-228
lines changed- src
- backend/access/nbtree
- include/access
- port
4 files changed
+388
-228
lines changedLines changed: 51 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
37 |
| - | |
| 36 | + | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
70 |
| - | |
71 |
| - | |
72 |
| - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
| 76 | + | |
77 | 77 |
| |
78 |
| - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
79 | 84 |
| |
80 | 85 |
| |
81 | 86 |
| |
82 | 87 |
| |
83 | 88 |
| |
84 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
85 | 98 |
| |
86 | 99 |
| |
87 | 100 |
| |
| |||
110 | 123 |
| |
111 | 124 |
| |
112 | 125 |
| |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
113 | 135 |
| |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 | 136 |
| |
121 | 137 |
| |
122 | 138 |
| |
| |||
126 | 142 |
| |
127 | 143 |
| |
128 | 144 |
| |
129 |
| - | |
| 145 | + | |
130 | 146 |
| |
131 | 147 |
| |
132 | 148 |
| |
133 |
| - | |
134 |
| - | |
135 | 149 |
| |
136 | 150 |
| |
137 | 151 |
| |
| |||
219 | 233 |
| |
220 | 234 |
| |
221 | 235 |
| |
222 |
| - | |
| 236 | + | |
223 | 237 |
| |
224 | 238 |
| |
225 | 239 |
| |
| |||
248 | 262 |
| |
249 | 263 |
| |
250 | 264 |
| |
251 |
| - | |
252 |
| - | |
| 265 | + | |
| 266 | + | |
253 | 267 |
| |
254 | 268 |
| |
255 | 269 |
| |
256 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
257 | 283 |
| |
258 | 284 |
| |
259 | 285 |
| |
| |||
312 | 338 |
| |
313 | 339 |
| |
314 | 340 |
| |
315 |
| - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
316 | 345 |
| |
317 | 346 |
| |
318 | 347 |
| |
| |||
533 | 562 |
| |
534 | 563 |
| |
535 | 564 |
| |
536 |
| - | |
| 565 | + | |
537 | 566 |
| |
538 | 567 |
| |
539 | 568 |
| |
|
0 commit comments
Comments
(0)