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 1khxyU-0006yX-EW for pgsql-general@arkaria.postgresql.org; Wed, 25 Nov 2020 16:48:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1khxyT-0003Gk-1D for pgsql-general@arkaria.postgresql.org; Wed, 25 Nov 2020 16:48:57 +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 1khxyS-0003Fu-Q4 for pgsql-general@lists.postgresql.org; Wed, 25 Nov 2020 16:48:56 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1khxyP-0006Ei-Nv for pgsql-general@lists.postgresql.org; Wed, 25 Nov 2020 16:48:55 +0000 Received: by mail-lj1-x22e.google.com with SMTP id j10so2998982lja.5 for ; Wed, 25 Nov 2020 08:48:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duneanalytics-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:organization:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=MH7e+P1fFUPxzlvQakVCNWFE4kLlkqPmtD2AaAMIgZM=; b=PsxCmscYBJ9xAJRwPdvuFZKTzdt/PdWdd1BujyC8ODxunoRIDij7TPcDo7oq613RqT bV+3CYYouKwQPwaulkl2RV7anJhajkRDni4bsILan4EgtgH3UCD9ysRS35iQcA994jZ3 cLcbLpahohGAk0weZLrRnGpGEv5Dexm2WTnF4rtCbzUdPvl9L3/vkqAsQZaTtsOXU9lw rNQOtnN1Ut7i8X38bbqaddHrB5CCYR/No52tc7btU6rBk/gQeDobSPQzU7n02oGBWpS9 1yYMX/tjixF8XnXG+LPoOEsBEUE+jeTR3UVdIwyAJXM2aybu6l0yseo7bL2PFG/n30gs m9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=MH7e+P1fFUPxzlvQakVCNWFE4kLlkqPmtD2AaAMIgZM=; b=HCXbN2cj8i1/KG3BLCW/bUJX5mnmbnZT8GTSfx4X9UgoK5weFGPHsHfk48JcYl0Jcb 3vBRi80g++iyXsOGtVydJI+lEMsJ5UrfTGE5EUXCL5Z8xtGpSu8EbJM3ifF2YobiTS54 1WZYhZuFzXB019ewbV627wFurOTlusciqNCifm09HKo4OabG07IUBcf068b7iBeD5S7W v5sTs8juRpLdXxkGhKGyHkJiXiGuvezJfz5sYTuxNBXOLyCODQFOaAU2CTnAmNh+WKo/ 8+KH6Z1Y0kJ8eKOIHrdd5v0G2GsCGBhYY+Zx6eHjaLGdsrHsfdRBI2vwp6BsIsksqBOF cpcg== X-Gm-Message-State: AOAM533kjFFANwFWr4rSLmS3gxtWXt5Cxxn++BKjsIIlOFbbIUkd5YGw 0ScQhxADKCYOBuvs70ZZBfY3S9KXE2FYKPijB2w= X-Google-Smtp-Source: ABdhPJxn1MD/BsyuvBCqxjg1T4+Z2Nwtbzus8XhwLO56khU/+XB9BV8G/S0S7E11LVV4CqMZ+diryw== X-Received: by 2002:a2e:8e87:: with SMTP id z7mr1578378ljk.254.1606322931500; Wed, 25 Nov 2020 08:48:51 -0800 (PST) Received: from [192.168.1.149] (host-37-191-231-244.lynet.no. [37.191.231.244]) by smtp.gmail.com with ESMTPSA id l13sm309986lje.45.2020.11.25.08.48.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Nov 2020 08:48:50 -0800 (PST) Subject: Re: postgres_fdw insert extremely slow To: Adrian Klaver , pgsql-general@lists.postgresql.org References: <3862aa4d-01c7-c76b-4497-ebce1af702cc@aklaver.com> From: Mats Julian Olsen Organization: Dune Analytics Message-ID: <10df210c-a1bb-f909-9a48-61ac54880df0@duneanalytics.com> Date: Wed, 25 Nov 2020 17:48:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <3862aa4d-01c7-c76b-4497-ebce1af702cc@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Apologies for the sloppiness! > Postgres version(s)? x: Aurora PostgreSQL 11.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.9.3, 64-bit (RDS) y: PostgreSQL 12.2 (Ubuntu 12.2-2.pgdg19.10+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, 64-bit (GCP) > > Without the actual query and EXPLAIN ANALYZE on it this will be > difficult to answer with any detail. > > Also would be nice to have the table schema. > Here's the query, schema and the EXPLAIN ANALYZE query: https://gist.github.com/mewwts/704663e19a21bc51864f3298f09a18c0 plan: https://explain.depesz.com/s/RQFQ Best, -- Mats CTO @ Dune Analytics We're hiring: https://careers.duneanalytics.com