RE: POC: postgres_fdw insert batching

From: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
To: 'Tomas Vondra' <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: 'Tomas Vondra' <tomas(dot)vondra(at)2ndquadrant(dot)com>, "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: POC: postgres_fdw insert batching
Date: 2020-11-17 09:11:55
Message-ID: OSBPR01MB298268F1A1BACFCE61740CC3FEE20@OSBPR01MB2982.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Modified the patch as I talked with Tomas-san. The performance results of loading one million records into a hash-partitioned table with 8 partitions are as follows:

unpatched, local: 8.6 seconds
unpatched, fdw: 113.7 seconds
patched, fdw: 12.5 seconds (9x improvement)

The test scripts are also attached. Run prepare.sql once to set up tables and source data. Run local_part.sql and fdw_part.sql to load source data into a partitioned table with local partitions and a partitioned table with foreign tables respectively.

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
fdw.sql application/octet-stream 52 bytes
fdw_part.sql application/octet-stream 222 bytes
local.sql application/octet-stream 51 bytes
local_part.sql application/octet-stream 63 bytes
prepare.sql application/octet-stream 3.9 KB
v2-0001-Add-bulk-insert-for-foreign-tables.patch application/octet-stream 34.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-11-17 09:49:38 Re: Cache relation sizes?
Previous Message Li Japin 2020-11-17 09:01:58 Re: Terminate the idle sessions