-
Notifications
You must be signed in to change notification settings - Fork 115
Support parallel DuckDB threads for Postgres table scan #762
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
Changes from all commits
2635fc9
9e00eb6
7619d86
201cd84
a308506
5c4f524
f76c7c6
4a6b2d9
37b0b6d
755756a
cb89571
fa358eb
49268c4
47f6805
00d5754
50eb9a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,18 @@ TupleIsNull(TupleTableSlot *slot) { | |
|
||
void | ||
SlotGetAllAttrs(TupleTableSlot *slot) { | ||
PostgresFunctionGuard(slot_getallattrs, slot); | ||
// It is safe to call slot_getallattrs directly without the PostgresFunctionGuard because the function doesn't | ||
// perform any memory allocations. Assertions or errors are guaranteed not to occur for minimal slots. | ||
slot_getallattrs(slot); | ||
} | ||
|
||
TupleTableSlot * | ||
ExecStoreMinimalTupleUnsafe(MinimalTuple minmal_tuple, TupleTableSlot *slot, bool shouldFree) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly to the comment I left above. Let's add a comment why this is safe to use without the lock. Something like:
And just like the function above let's drop the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// It's safe to call ExecStoreMinimalTuple without the PostgresFunctionGuard as long as the slot is not "owned" by | ||
// the tuple, i.e., TTS_SHOULDFREE(slot) is false. This is because it does not allocate in memory contexts and the | ||
// only error it can throw is when the slot is not a minimal slot. That error is an obvious programming error so we | ||
// can ignore it here. | ||
return ::ExecStoreMinimalTuple(minmal_tuple, slot, shouldFree); | ||
} | ||
|
||
Relation | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 32? Maybe we should we make this configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was concerned about burdening users with another GUC hyperparameter.
I tested batch sizes of 8, 16, 32, and 64, and found that 32 performs the best. BTW, the batch size helps to amortize the lock overhead across threads.