forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2df5d46
committed
Avoid searching for callback functions in CallSyscacheCallbacks().
We have now grown enough registerable syscache-invalidation callbackfunctions that the original assumption that there would be few of themis causing performance problems. In particular, let's fix things so thatCallSyscacheCallbacks doesn't have to search the whole array to findwhich callback(s) to invoke for a given cache ID. Preserve the originalbehavior that callbacks are called in order of registration, just incase there's someplace that depends on that (which I doubt).In support of this, export the number of syscaches from syscache.h.People could have found that out anyway from the enum, but adding a#define makes that much safer.This provides a useful additional speedup in Mathieu Fenniak'slogical-decoding test case, although we're reaching the point ofdiminishing returns there. I think any further improvement will haveto come from reducing the number of cache invalidations that aretriggered in the first place. Still, we can hope that this changegives some incremental benefit for all invalidation scenarios.Back-patch to 9.4 where logical decoding was introduced.Discussion:https://postgr.es/m/CAHoiPjzea6N0zuCi=+f9v_j94nfsy6y8SU7-=bp4=7qw6_i=Rg@mail.gmail.com1 parent9ed74fd commit2df5d46
File tree
3 files changed
+40
-6
lines changed- src
- backend/utils/cache
- include/utils
3 files changed
+40
-6
lines changedLines changed: 35 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
180 |
| - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
181 | 186 |
| |
182 | 187 |
| |
183 | 188 |
| |
| |||
186 | 191 |
| |
187 | 192 |
| |
188 | 193 |
| |
| 194 | + | |
189 | 195 |
| |
190 | 196 |
| |
191 | 197 |
| |
192 | 198 |
| |
| 199 | + | |
| 200 | + | |
193 | 201 |
| |
194 | 202 |
| |
195 | 203 |
| |
| |||
1383 | 1391 |
| |
1384 | 1392 |
| |
1385 | 1393 |
| |
| 1394 | + | |
| 1395 | + | |
1386 | 1396 |
| |
1387 | 1397 |
| |
1388 | 1398 |
| |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1389 | 1414 |
| |
| 1415 | + | |
1390 | 1416 |
| |
1391 | 1417 |
| |
1392 | 1418 |
| |
| |||
1426 | 1452 |
| |
1427 | 1453 |
| |
1428 | 1454 |
| |
1429 |
| - | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
1430 | 1460 |
| |
1431 | 1461 |
| |
1432 | 1462 |
| |
1433 |
| - | |
1434 |
| - | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1435 | 1466 |
| |
1436 | 1467 |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
971 | 971 |
| |
972 | 972 |
| |
973 | 973 |
| |
974 |
| - | |
975 |
| - | |
976 | 974 |
| |
977 | 975 |
| |
978 | 976 |
| |
| |||
1003 | 1001 |
| |
1004 | 1002 |
| |
1005 | 1003 |
| |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1006 | 1007 |
| |
1007 | 1008 |
| |
1008 | 1009 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
| 111 | + | |
| 112 | + | |
111 | 113 |
| |
112 | 114 |
| |
113 | 115 |
| |
|
0 commit comments
Comments
(0)