Re: postgres_fdw batching vs. (re)creating the tuple slots - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: postgres_fdw batching vs. (re)creating the tuple slots
Date
Msg-id a3233163-829d-94a0-7ca0-87bdfde92c90@enterprisedb.com
Whole thread Raw
In response to Re: postgres_fdw batching vs. (re)creating the tuple slots  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: postgres_fdw batching vs. (re)creating the tuple slots
List pgsql-hackers
Hi,

Here's two WIP patches that fixes the regression for me. The first part
is from [1], so make large batches work, 0002 just creates a copy of the
tupledesc to not cause issues in resource owner, 0003 ensures we only
initialize the slots once (not per batch).

With the patches applied, the timings look like this:

 batch          timing
 ----------------------
     1    64194.942 ms
    10     7233.785 ms
   100     2244.255 ms
   32k     1372.175 ms

which seems fine. I still need to get this properly tested etc. and make
sure nothing is left over.

regards


[1]
https://postgr.es/m/OS0PR01MB571603973C0AC2874AD6BF2594299%40OS0PR01MB5716.jpnprd01.prod.outlook.com

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Skip partition tuple routing with constant partition key
Next
From: Tomas Vondra
Date:
Subject: Re: postgres_fdw batching vs. (re)creating the tuple slots