snippetsqlMinor
How do I set the option use_remote_estimate?
Viewed 0 times
theuse_remote_estimateoptionhowset
Problem
Where do I set the "Cost Estimation Options" for
postgres_fdw. Specifically I want to add use_remote_estimate.test=# SET use_remote_estimate=true;
ERROR: unrecognized configuration parameter "use_remote_estimate"Solution
postgres_fdw doesn't use GUC variables. The settings for postgres_fdw are actually set with options under CREATE SERVER,CREATE SERVER [IF NOT EXISTS] server_name [ TYPE 'server_type' ] [ VERSION 'server_version' ]
FOREIGN DATA WRAPPER fdw_name
[ OPTIONS ( option 'value' [, ... ] ) ];Or with
ALTER SERVERChange options for the server.
ADD, SET, and DROP specify the action to be performed. ADD is assumed if no operation is explicitly specified. Option names must be unique; names and values are also validated using the server's foreign-data wrapper library.Like,
-- Set it if it's never been set
ALTER SERVER flybase
OPTIONS (ADD use_remote_estimate 'true');
-- Change it if it has been set
ALTER SERVER flybase
OPTIONS (SET use_remote_estimate 'false');
-- Drop it if it has never been set
ALTER SERVER flybase
OPTIONS (DROP use_remote_estimate);Code Snippets
CREATE SERVER [IF NOT EXISTS] server_name [ TYPE 'server_type' ] [ VERSION 'server_version' ]
FOREIGN DATA WRAPPER fdw_name
[ OPTIONS ( option 'value' [, ... ] ) ];-- Set it if it's never been set
ALTER SERVER flybase
OPTIONS (ADD use_remote_estimate 'true');
-- Change it if it has been set
ALTER SERVER flybase
OPTIONS (SET use_remote_estimate 'false');
-- Drop it if it has never been set
ALTER SERVER flybase
OPTIONS (DROP use_remote_estimate);Context
StackExchange Database Administrators Q#194507, answer score: 8
Revisions (0)
No revisions yet.