forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit720b59b
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 parent80d0e5b commit720b59b
File tree
3 files changed
+0
-44
lines changed- src
- backend/utils/cache
- include/utils
3 files changed
+0
-44
lines changedLines changed: 0 additions & 42 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5913 | 5913 |
| |
5914 | 5914 |
| |
5915 | 5915 |
| |
5916 |
| - | |
5917 |
| - | |
5918 |
| - | |
5919 |
| - | |
5920 |
| - | |
5921 |
| - | |
5922 |
| - | |
5923 |
| - | |
5924 |
| - | |
5925 |
| - | |
5926 |
| - | |
5927 |
| - | |
5928 |
| - | |
5929 |
| - | |
5930 |
| - | |
5931 |
| - | |
5932 |
| - | |
5933 |
| - | |
5934 |
| - | |
5935 |
| - | |
5936 |
| - | |
5937 |
| - | |
5938 |
| - | |
5939 |
| - | |
5940 |
| - | |
5941 |
| - | |
5942 |
| - | |
5943 |
| - | |
5944 |
| - | |
5945 |
| - | |
5946 |
| - | |
5947 |
| - | |
5948 |
| - | |
5949 |
| - | |
5950 |
| - | |
5951 |
| - | |
5952 |
| - | |
5953 |
| - | |
5954 |
| - | |
5955 |
| - | |
5956 |
| - | |
5957 |
| - | |
5958 | 5916 |
| |
5959 | 5917 |
| |
5960 | 5918 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
605 | 605 |
| |
606 | 606 |
| |
607 | 607 |
| |
608 |
| - | |
609 | 608 |
| |
610 | 609 |
|
Lines changed: 0 additions & 1 deletion
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)