Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpuCP-000173-GN for pgsql-admin@arkaria.postgresql.org; Wed, 15 Aug 2018 11:42:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpuCM-0000ry-58 for pgsql-admin@arkaria.postgresql.org; Wed, 15 Aug 2018 11:42:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpuCL-0000rr-Rj for pgsql-admin@lists.postgresql.org; Wed, 15 Aug 2018 11:42:45 +0000 Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fpuCI-00026s-Bg for pgsql-admin@lists.postgresql.org; Wed, 15 Aug 2018 11:42:45 +0000 Received: by mail-oi0-x22f.google.com with SMTP id w126-v6so1411919oie.7 for ; Wed, 15 Aug 2018 04:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NFggiYSJwqmwt2EAuIafgLFvbzuvwYnx0vxdJ+IbkWU=; b=C0Cn101AdQOOvc40S4KSIMzM1bH/6C88gJklks/f9BQbsoPHXU9VGmnpV+Ou46vvm4 g9d/AD9pPpoU6Qc97G3W4dhaG7arZK29k3s7KBTHpPMY5OBn2bJmzXHjkuuiRQQXUxxl toX4SmITspCc1uDe1usJMX4qyzjPZXor3QbhZfq3OIZIv72uhsIwu4w7estWelddS3C5 0zihfr566MSsFHFHNge/+Eewk9l17kax3/+NV4YXit2otHKD0scFK7DEy+cwckdMC34D 3NJuGiDx4Q2ifEQQtZgCliY6At1lPW4/DwlKuw4jpfQCq9FYhEzWBeukRz5eWtokOdOC Grgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NFggiYSJwqmwt2EAuIafgLFvbzuvwYnx0vxdJ+IbkWU=; b=Tq8VKf3VtR7bOfiCrYrKettVDg/3ohLMJ4e/PWqHWY2mQK0Q+jVNReHfbeaRUGtUYs pRGd2ucU+lUxmTFb/Osw7wohbtnsY5ohNcmjGLoT1XMB3YHnIxuoK7ML8kAMW5wJfWOt FAa8RNGNErEchOYOQzqBPLBbP2s5Cr2C7b3bS+4co+5g8HTAvFlFT9yD4rowpdNOIl89 zSHLTANIyh9wBONs8tnttzQt3OSEiBzyUINZ0SLgBcHKE8QgdzmGKBkTtd3Ft7r7xNHN omwXldLgRW3dlZWcYjnnyj7P2z/q57WQOZ84HKfy1JiFmzhPfbNtHE0yDlF7QLTutLAt P8bQ== X-Gm-Message-State: AOUpUlElgKHvR9PJJFvX138DwIzv82WhI4AtEUYuI5awXxP2lgLk4z2r xSGyhog38AaZyOug7JarU+w= X-Google-Smtp-Source: AA+uWPw2jKmSwHLhXWxEcbk8NYWrJfozkFStGYSxPQ/XmcK9oqb7mgdf44GPwWwbz4ipjdkgJzZl2g== X-Received: by 2002:aca:7203:: with SMTP id p3-v6mr24495920oic.194.1534333359971; Wed, 15 Aug 2018 04:42:39 -0700 (PDT) Received: from [172.20.20.20] ([73.91.230.83]) by smtp.gmail.com with ESMTPSA id s3-v6sm20341775oif.22.2018.08.15.04.42.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 04:42:38 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: increase insert into local table from remote oracle table preformance From: Andrew Kerber X-Mailer: iPad Mail (15G77) In-Reply-To: <1534230760.2379.6.camel@cybertec.at> Date: Wed, 15 Aug 2018 06:42:37 -0500 Cc: Mariel Cherkassky , pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <305B48BC-C989-4CE5-AFCE-64E985F2D590@gmail.com> References: <1534230760.2379.6.camel@cybertec.at> To: Laurenz Albe List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk You need to track down your limited resource. IO, CPU, or network. I would= say it=E2=80=99s unlikely to be CPU, but you never know. Look at the activ= ities on each server and see what resource is maxed out. My guess is IO, but= you could also have your network choked. =20 Sent from my iPad > On Aug 14, 2018, at 02:12, Laurenz Albe wrote: >=20 > Mariel Cherkassky wrote: >> Hi, >> I'm using postgresql v10.4. I have a local partitioned table (by range - d= ata, every day has its own table). >> I'm using the oracle_fdw extension to bring data from the oracle partitio= ned table into my local postgresql >> (insert into local select * from remote_oracle). Currently, I dont have a= ny indexes on the postgresql`s table. >> It takes me 10 hours to copy 200G over the network and it is very slow. >> Any recommandations what can I change or improve ? >=20 > Hard to say anything with so little data. >=20 > You could try a bigger value for the "prefetch" option. >=20 > One known reason for slow performance is if there are LOBs in the Oracle t= able. >=20 > You could parallelize processing by running several such INSERTs in > parallel, perhaps one per partition, and inserting directly into > the partitions. >=20 > Yours, > Laurenz Albe > --=20 > Cybertec | https://www.cybertec-postgresql.com >=20