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.
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
lightning: support prepared statement and client stmt cache in logical import mode #55482
lightning: support prepared statement and client stmt cache in logical import mode #55482
Changes from 21 commits
d457da8
8412357
b0c79df
7237d94
df855d6
07592bb
4be22d7
5243b09
ee6704e
cb332bf
1fd3ce7
17db4e6
8f2437e
afe73a5
3d6e4e4
4dc3fdc
a80c974
066f7f8
5b808ae
132c4a3
2c0bc66
539a0d1
3e08969
0bae547
0c25621
1ce0977
662f938
6727f20
8869768
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm not sure why the
kvcache.Key
interface call itHash
. Hash means a fixed-length digest)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.
as long as the table is importing, the prepared stmt is needed, no need such LRU
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.
The reason to use LRU here is that the batch insert prepared statement may not be the same. where the insert/replace statement is constrained by
logical-import-batch-size
, the actual SQL executed might be longer or shorter, depending on the actual content imported.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.
depends on row size is unstable for prepared stmt, in worse case, every prepared stmt is different. we can ignore batch-size in this case, and only honors batch-rows, cc @lance6716
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.
the default
logical-import-batch-rows
is 65536, usually this batch size is too large, should we lower the default value oflogical-import-batch-rows
to some reasonable number like 128/256/512?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.
Maybe we can ask the user that request this feature what's the root cause #46607 . If the prepared statement can solve that problem, we can ignore these configurations. @D3Hunter and I are busy this week, please help to contact the issue author.
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.
Not the author of #46607, but we've got customer which database is unable to handle 96 KB transactions thus requiring the limit to be lowered.
The
-batch-size
does not need to be very precise. It is mainly used to ensure (number of rows) × (size of row) to be maintained at a constant limit. You should not ignore the batch-size entirely because the same limit is shared among all tables and the constraint should be reasonable for both wide and narrow tables.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.