forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb9c4ccf
committed
Avoid catalog lookups in RelationAllowsEarlyPruning().
RelationAllowsEarlyPruning() performed a catalog scan, but is usedin two contexts where that was a bad idea:1. In heap_page_prune_opt(), which runs very frequently in some large scans. This caused major performance problems in a field report that was easy to reproduce.2. In TestForOldSnapshot(), which runs while we hold a buffer content lock. It's not clear if this was guaranteed to be free of buffer deadlock risk.The check was introduced in commit2cc41ac and defended against areal problem: 9.6's hash indexes have no page LSN and so we can'tallow early pruning (ie the snapshot-too-old feature). We can removethe check from all later releases though: hash indexes are now logged,and there is no way to create UNLOGGED indexes on regular loggedtables.If a future release allows such a combination, it might need to puta similar check in place, but it'll need some more thought.Back-patch to 10.Author: Thomas MunroReviewed-by: Tom Lane, who spotted the second problemDiscussion:https://postgr.es/m/CA%2BhUKGKT8oTkp5jw_U4p0S-7UG9zsvtw_M47Y285bER6a2gD%2Bg%40mail.gmail.comDiscussion:https://postgr.es/m/CAA4eK1%2BWy%2BN4eE5zPm765h68LrkWc3Biu_8rzzi%2BOYX4j%2BiHRw%40mail.gmail.com1 parentf51006e commitb9c4ccf
File tree
3 files changed
+0
-44
lines changed- src
- backend/utils/cache
- include/utils
3 files changed
+0
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6025 | 6025 | | |
6026 | 6026 | | |
6027 | 6027 | | |
6028 | | - | |
6029 | | - | |
6030 | | - | |
6031 | | - | |
6032 | | - | |
6033 | | - | |
6034 | | - | |
6035 | | - | |
6036 | | - | |
6037 | | - | |
6038 | | - | |
6039 | | - | |
6040 | | - | |
6041 | | - | |
6042 | | - | |
6043 | | - | |
6044 | | - | |
6045 | | - | |
6046 | | - | |
6047 | | - | |
6048 | | - | |
6049 | | - | |
6050 | | - | |
6051 | | - | |
6052 | | - | |
6053 | | - | |
6054 | | - | |
6055 | | - | |
6056 | | - | |
6057 | | - | |
6058 | | - | |
6059 | | - | |
6060 | | - | |
6061 | | - | |
6062 | | - | |
6063 | | - | |
6064 | | - | |
6065 | | - | |
6066 | | - | |
6067 | | - | |
6068 | | - | |
6069 | | - | |
6070 | 6028 | | |
6071 | 6029 | | |
6072 | 6030 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
606 | 605 | | |
607 | 606 | | |
608 | 607 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
0 commit comments
Comments
(0)