
However, any more nuanced queries, especially involving joins to local tables, perform terribly. I can understand why this might be, since the optimiser can easily cut down the amount of data to be retrieved in the remote instance. SELECT colA FROM tableX WHERE colB IN (value1, value2.valueN). Queries with specific literal key values seem to perform reasonably well, e.g. So the problem is clearly something to do with the connection, via an SSH tunnel, through the AWS firewall and on to the remote AWS Postgresql instance. If I use the exact same FDW configuration on an AWS-hosted server (but still on a different host to the AWS Postgresql instance), performance is fine. This works correctly from a functional aspect but the performance is very poor. I've set up a Foreign Data Wrapper in a local schema. Something like this: Local host port 4001 | AWS firewall | Target host port 5432 Target Postgres server

Local server Postgresql version is 14.2, remote AWS server version is 11.9.The local server and the SSH connection is running on MacOS, the jumpbox and remote Postgresql server are all on Linux.I connect to that server from my local host via an SSH tunnel to an AWS "jumpbox" instance, which then connects to the host and port of the AWS Postgres server.Remote data is on a Postgres instance running in AWS.I'm experiencing severe performance issues when trying to access data from a remote Postgresql server running on AWS, accessed via an SSH tunnel, using a foreign data wrapper on a local non-AWS Postgresql server.
