forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commiteeb68c1
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 parent19bfa15 commiteeb68c1
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 | |
|---|---|---|---|
| |||
6068 | 6068 | | |
6069 | 6069 | | |
6070 | 6070 | | |
6071 | | - | |
6072 | | - | |
6073 | | - | |
6074 | | - | |
6075 | | - | |
6076 | | - | |
6077 | | - | |
6078 | | - | |
6079 | | - | |
6080 | | - | |
6081 | | - | |
6082 | | - | |
6083 | | - | |
6084 | | - | |
6085 | | - | |
6086 | | - | |
6087 | | - | |
6088 | | - | |
6089 | | - | |
6090 | | - | |
6091 | | - | |
6092 | | - | |
6093 | | - | |
6094 | | - | |
6095 | | - | |
6096 | | - | |
6097 | | - | |
6098 | | - | |
6099 | | - | |
6100 | | - | |
6101 | | - | |
6102 | | - | |
6103 | | - | |
6104 | | - | |
6105 | | - | |
6106 | | - | |
6107 | | - | |
6108 | | - | |
6109 | | - | |
6110 | | - | |
6111 | | - | |
6112 | | - | |
6113 | 6071 | | |
6114 | 6072 | | |
6115 | 6073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
641 | | - | |
642 | 641 | | |
643 | 642 | | |
644 | 643 | | |
| 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)