Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khyLI-0000N1-W6 for pgsql-general@arkaria.postgresql.org; Wed, 25 Nov 2020 17:12:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1khyLH-0007ah-Qj for pgsql-general@arkaria.postgresql.org; Wed, 25 Nov 2020 17:12:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khyLH-0007aa-Jb for pgsql-general@lists.postgresql.org; Wed, 25 Nov 2020 17:12:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khyLF-0006PF-N1 for pgsql-general@lists.postgresql.org; Wed, 25 Nov 2020 17:12:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0APHCPKp494597; Wed, 25 Nov 2020 12:12:26 -0500 From: Tom Lane To: Mats Julian Olsen cc: Adrian Klaver , pgsql-general@lists.postgresql.org, wilhelm@duneanalytics.com Subject: Re: postgres_fdw insert extremely slow In-reply-to: References: <3862aa4d-01c7-c76b-4497-ebce1af702cc@aklaver.com> <10df210c-a1bb-f909-9a48-61ac54880df0@duneanalytics.com> <493978.1606323509@sss.pgh.pa.us> Comments: In-reply-to Mats Julian Olsen message dated "Wed, 25 Nov 2020 18:06:52 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <494595.1606324345.1@sss.pgh.pa.us> Date: Wed, 25 Nov 2020 12:12:25 -0500 Message-ID: <494596.1606324345@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mats Julian Olsen writes: > On 25.11.2020 17:58, Tom Lane wrote: >> ... Have you tried looking into pg_locks on the >> remote server while this query is running? > Thanks Tom, I'll try to spin up a regular Postgres instance on both rds > and ec2 and see if that helps. As for the locks, I can not see any > blocked activity on the remote server while the query runs. Another place to check is pg_stat_activity, specifically wait_event_type and wait_event. regards, tom lane