-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Narek/ezra work mem #205
Merged
Merged
Narek/ezra work mem #205
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
=======================================
Coverage 83.05% 83.06%
=======================================
Files 18 18
Lines 1216 1234 +18
Branches 261 264 +3
=======================================
+ Hits 1010 1025 +15
- Misses 81 83 +2
- Partials 125 126 +1
|
Benchmarks
|
Ngalstyan4
force-pushed
the
narek/ezra_work_mem
branch
3 times, most recently
from
October 15, 2023 23:14
c3c856b
to
ae27f6f
Compare
Ngalstyan4
force-pushed
the
narek/ezra_work_mem
branch
from
October 15, 2023 23:25
ae27f6f
to
39f34ca
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Copied from Ezra's pr (#200):
This adds checks for the
work_mem
andmaintenance_work_mem
GUC variables. Checks for both are fairly uncommon in the upstream extensions. It seems likemaintenance_work_mem
is checked more often thanwork_mem
this may be because it's greater size makes it less prohibitive to respect. Neither is actually enforced by postgres. I'll list some examples belowmaintenance_work_mem
is referenced more infrequently but its use is pretty straightforward when it isin
src/backend/access/gin/gininsert.c
in the build callback functionmaintenance_work_mem
is checkedsimilarly nbtree checks it in its parallel build functions
src/backend/access/nbtree/nbtsort.c
It is also checked in
src/backend/commands/vacuumparallel.c
. It is never checked in contrib. I think thebloom
in the earlier listing refers to an internal bloomfilter, not the extension. Notably though pgvector does have a checkwork_mem
is also checked very infrequently although within the optimizer/executor there are a number of checks.in
src/backend/access/gin/ginfast.c
it gets checkedit gets checked in
src/backend/access/nbtree/nbtpage.c
as well, albeit in a function that is only called during vacuumsI have however found the following calling pattern in several places including
contrib/tablefunc/tablefunc.c
,contrib/dblink/dblink.c
,contrib/adminpack/adminpack.c
and also pgvector (albeit only in ivfscans)this seems to be a data structure that holds tuples to be returned by a scan. It doesn't account for memory allocated elsewhere though. Overall the lack of enforcement seems to make checking these values somewhat uncommon. I think it makes sense to enforce
maintenance_work_mem
because building an index is relatively infrequent, but maybe enforcing runtime checks forwork_mem
is overkill