Batch rewriting logarithmic logic #3237
Replies: 7 comments 9 replies
-
The relevant code is I think you might be correct. |
Beta Was this translation helpful? Give feedback.
-
The performance reason is to limit the number of distinct sql statements in
use. Each batch size is a unique sql statement.
…On Thu, May 2, 2024 at 12:14 PM Olivier Depriester ***@***.***> wrote:
When using the reWriteBatchedInserts flag, the way the batched queries
are rewritten seems a bit awkward.
Example: if I batch 500 INSERT, it ends with submitting to postres
- 3 batches of 128
- 1 batch of 64
- 1 batch of 32
- 1 batch of 16
- 1 batch of 4
Total is 500 so all rows are sent but I would have expected ;
- 3 batches of 128
- *1 batch of 116*
Is there any performance reason for this splitting ?
—
Reply to this email directly, view it on GitHub
<#3237>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAW3U3JCTTRC2YKRCCBEJS3ZAJX5XAVCNFSM6AAAAABHEDQSIWVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGU4TOMRXGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This guy was timing performance for the multirow insert and his finding looks pretty linear and might suggest that the 128 limit does not really exist. |
Beta Was this translation helpful? Give feedback.
-
That doesn't account for network time. |
Beta Was this translation helpful? Give feedback.
-
So looking at his results again I think it proves exactly what we think. |
Beta Was this translation helpful? Give feedback.
-
OK, I used exactly the same function as the article referred to and here are the results
|
Beta Was this translation helpful? Give feedback.
-
As I understand it the timing numbers are for the total 20,000 records to be inserted so I'm unclear where the |
Beta Was this translation helpful? Give feedback.
-
When using the
reWriteBatchedInserts
flag, the way the batched queries are rewritten seems a bit awkward.Example: if I batch 500 INSERT, it ends with submitting to postres
Total is 500 so all rows are sent but I would have expected ;
Is there any performance reason for this splitting ?
Beta Was this translation helpful? Give feedback.
All reactions