forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8cc6016
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 parente96f524 commit8cc6016
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 | |
|---|---|---|---|
| |||
5941 | 5941 | | |
5942 | 5942 | | |
5943 | 5943 | | |
5944 | | - | |
5945 | | - | |
5946 | | - | |
5947 | | - | |
5948 | | - | |
5949 | | - | |
5950 | | - | |
5951 | | - | |
5952 | | - | |
5953 | | - | |
5954 | | - | |
5955 | | - | |
5956 | | - | |
5957 | | - | |
5958 | | - | |
5959 | | - | |
5960 | | - | |
5961 | | - | |
5962 | | - | |
5963 | | - | |
5964 | | - | |
5965 | | - | |
5966 | | - | |
5967 | | - | |
5968 | | - | |
5969 | | - | |
5970 | | - | |
5971 | | - | |
5972 | | - | |
5973 | | - | |
5974 | | - | |
5975 | | - | |
5976 | | - | |
5977 | | - | |
5978 | | - | |
5979 | | - | |
5980 | | - | |
5981 | | - | |
5982 | | - | |
5983 | | - | |
5984 | | - | |
5985 | | - | |
5986 | 5944 | | |
5987 | 5945 | | |
5988 | 5946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | 609 | | |
611 | 610 | | |
612 | 611 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
0 commit comments
Comments
(0)