Why insertion throughput can be reduced with an increase of batch size? - Mailing list pgsql-general

From Павел Филонов
Subject Why insertion throughput can be reduced with an increase of batch size?
Date
Msg-id CADcp+YCS1=EX+nNtcCWPTy3-BrT+XPJ3kwJkz_Fjp0hyvPRfKg@mail.gmail.com
Whole thread Raw
Responses Re: Why insertion throughput can be reduced with an increase of batch size?  (Jeff Janes <jeff.janes@gmail.com>)
Re: Why insertion throughput can be reduced with an increase of batch size?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
My greetings to everybody!

I recently faced with the observation which I can not explain. Why insertion throughput can be reduced with an increase of batch size?

Brief description of the experiment.

Experiment steps:

  • populate DB with 259200000 random records
  • start insertion for 60 seconds with one client thread and batch size = m
  • record insertions per second (ips) in clients code

Plot median ips from m for m in [2^0, 2^1, ..., 2^15] (in attachment).


On figure with can see that from m = 128 to m = 256 throughput have been reduced from 13 000 ips to 5000.

I hope someone can help me understand what is the reason for such behavior?

--
Best regards
Filonov Pavel
Attachment

pgsql-general by date:

Previous
From: gilad905
Date:
Subject: Re: Easiest way to compare the results of two queries row by row and column by column
Next
From: "David G. Johnston"
Date:
Subject: Re: Unique constraint on field inside composite type.