forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit40064a8
committed
Optimize InvalidateAttoptCacheCallback() and TypeCacheTypCallback()
These callbacks are receiving hash values as arguments, which doesn't allowdirect lookups for AttoptCacheHash and TypeCacheHash. This is why subjectcallbacks currently use full iteration over corresponding hashes.This commit avoids full hash iteration in InvalidateAttoptCacheCallback(),and TypeCacheTypCallback(). At first, we switch AttoptCacheHash andTypeCacheHash to use same hash function as syscache. As second, weuse hash_seq_init_with_hash_value() to iterate only hash entries with matchinghash value.Discussion:https://postgr.es/m/5812a6e5-68ae-4d84-9d85-b443176966a1%40sigaev.ruAuthor: Teodor SigaevReviewed-by: Aleksander Alekseev, Tom Lane, Michael Paquier, Roman ZharkovReviewed-by: Andrei Lepikhov1 parentd0f0200 commit40064a8
2 files changed
+73
-21
lines changedLines changed: 33 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 |
| - | |
| 47 | + | |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
51 |
| - | |
52 |
| - | |
| 50 | + | |
53 | 51 |
| |
54 | 52 |
| |
55 | 53 |
| |
56 | 54 |
| |
57 | 55 |
| |
58 | 56 |
| |
59 | 57 |
| |
60 |
| - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
61 | 68 |
| |
62 | 69 |
| |
63 | 70 |
| |
| |||
70 | 77 |
| |
71 | 78 |
| |
72 | 79 |
| |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
73 | 92 |
| |
74 | 93 |
| |
75 | 94 |
| |
| |||
82 | 101 |
| |
83 | 102 |
| |
84 | 103 |
| |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
85 | 112 |
| |
86 | 113 |
| |
87 |
| - | |
| 114 | + | |
88 | 115 |
| |
89 | 116 |
| |
90 | 117 |
| |
|
Lines changed: 40 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
331 | 331 |
| |
332 | 332 |
| |
333 | 333 |
| |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
334 | 344 |
| |
335 | 345 |
| |
336 | 346 |
| |
| |||
355 | 365 |
| |
356 | 366 |
| |
357 | 367 |
| |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
358 | 376 |
| |
359 |
| - | |
| 377 | + | |
360 | 378 |
| |
361 | 379 |
| |
362 | 380 |
| |
| |||
407 | 425 |
| |
408 | 426 |
| |
409 | 427 |
| |
410 |
| - | |
411 |
| - | |
| 428 | + | |
412 | 429 |
| |
413 | 430 |
| |
414 | 431 |
| |
| |||
2358 | 2375 |
| |
2359 | 2376 |
| |
2360 | 2377 |
| |
2361 |
| - | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
2362 | 2389 |
| |
2363 | 2390 |
| |
2364 |
| - | |
2365 |
| - | |
2366 |
| - | |
2367 |
| - | |
2368 |
| - | |
2369 |
| - | |
2370 |
| - | |
2371 |
| - | |
2372 |
| - | |
2373 |
| - | |
2374 |
| - | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
2375 | 2400 |
| |
2376 | 2401 |
| |
2377 | 2402 |
| |
|
0 commit comments
Comments
(0)