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.
I affirm:
What does this pull request do?
This definitely DOES speed it up:
Buuuuut...
The thing is that range on these bothers me. those are quite large gaps between the smallest and largest times I saw. Different sources online make conflicting claims about which operations are faster. One person claiming REPLACE statements are 32x slower than ON DUPLICATE KEY UPDATE yet in my testing REPLACE was 200% faster, other claiming ON DUPLICATE KEY UPDATE was faster than a regular UPDATE statement, which I don't see how that can be physically possible - on duplicate attempt an insert and then when it fails, does an update. its literally the same update. REPLACE does a delete followed by an insert, and has minefields for situations involving foreign keys and auto increments.
So I did "real world testing" my dang self. You clearly can't trust what you read. And then I reached out to some experts I'm waiting to hear back from.
I'm not sure I want to move forward wit this yet, so its in draft mode pending response from persons more experienced than myself in SQL communities.
Here's some data in the meantime:
Steps to test these changes
Print those sql times
server/src/common/sql.cpp
Line 353 in 8f2779f
and run some queries that were updated in this pr.