[HACKERS] Proposal to add work_mem option to postgres_fdw module - Mailing list pgsql-hackers

From Shinoda, Noriyoshi (PN Japan GCS Delivery)
Subject [HACKERS] Proposal to add work_mem option to postgres_fdw module
Date
Msg-id TU4PR8401MB04306CD1C4D52F92CC2D5B5AEE3D0@TU4PR8401MB0430.NAMPRD84.PROD.OUTLOOK.COM
Whole thread Raw
Responses RE: [HACKERS] Proposal to add work_mem option to postgres_fdw module
Re: [HACKERS] Proposal to add work_mem option to postgres_fdw module
List pgsql-hackers

Hello hackers,

 

The attached patch adds a new option work_mem to postgres_fdw contrib module.

Previously, it was impossible to change the setting of work_mem for remote session with connection by postgres_fdw.

By adding this option to the CREATE SERVER statement, you can also change the work_mem setting for remote sessions with postgres_fdw.

 

Usage is the same as other options, and specify work_mem as an option of the CREATE SERVER statement. The string you specify is the same as the format of work_mem in GUC.

 

Example

----------

postgres=# CREATE SERVER remsvr1 FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( host 'remhost1', port '5433', dbname 'demodb', work_mem '16MB');

CREATE SERVER

 

Not only CREATE SERVER statement but ALTER SERVER statement are also available.

 

postgres=# ALTER SERVER remsvr1 OPTIONS ( SET work_mem '32MB');

ALTER SERVER

postgres=# SELECT * FROM pg_foreign_server;

-[ RECORD 1 ]----------------------------------------------------------

srvname    | remsvr1

srvowner   | 10

srvfdw     | 16389

srvtype    |

srvversion |

srvacl     |

srvoptions | {host=remhost1,port=5433,dbname=demodb,work_mem=32MB}

 

Within this patch, I implemented a change in GUC work_mem by specifying "options -c work_mem=value" for the PQconnectdbParams API function.

 

Best Regards,

Noriyoshi Shinoda

 

Attachment

pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: partitioning - changing a slot's descriptor is expensive
Next
From: Ashutosh Bapat
Date:
Subject: Re: TupleTableSlot abstraction