Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhIQG-0000pE-HK for pgsql-performance@arkaria.postgresql.org; Mon, 14 Aug 2017 16:41:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dhIQG-0001fN-2J for pgsql-performance@arkaria.postgresql.org; Mon, 14 Aug 2017 16:41:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dhIOT-0006q2-RE for pgsql-performance@postgresql.org; Mon, 14 Aug 2017 16:39:10 +0000 Received: from mail-qt0-x234.google.com ([2607:f8b0:400d:c0d::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dhIOR-0000Ab-EE for pgsql-performance@postgresql.org; Mon, 14 Aug 2017 16:39:08 +0000 Received: by mail-qt0-x234.google.com with SMTP id a18so54750334qta.0 for ; Mon, 14 Aug 2017 09:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=e9okNfbk3Dai23iJjxxewTUzcA+5WV15fT5AzfUurUk=; b=Onibbt0GvIePJ0ZDuIbKkeqzcwk/Z9s99KlV3dczcp07OE1cixVIfnEFDX0PXrI3xg Fkta9HgABXWz6vZBAUMz5vguLB1F8NiTXBGYEaVhGCpw1QQaiehtaKZdJOh0PVfbDvEn EURUxEdv4ptnwTSb4qBs3zaVp4xLGvLNT5fAVB4MNBbshD5LYc6FO0vg/lffTgxp3FsJ 0Y4jWSp2/nXa4ysAbUldZ6ILl1IURxn3Xr27CtSFKHVW9/JsQ2YfBMDNQ6xyz1FeK6X4 Ka1qmc33abr/s/MSBVtOte+umfzoBTtSbaWwme15uLOLgLDov1IoiWRQFHmkvC78/G+y u/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=e9okNfbk3Dai23iJjxxewTUzcA+5WV15fT5AzfUurUk=; b=W0ct0q84pnOQ9UsP8v/OQeDAPzqs3hz1BAw7DwEnGFyCAII2W3fxzlE5ThCF9s9Rfs 4QLnd0Dj769obR6/z0cICbuNL2uRz+Z6waCj03gR1ffBjGs+ibXxB3hSNLoltQWMEswt VDDWUHWsly8wP2U/hGgrr0i+4iXUt61w0mCKEUM7COmtDBarmxK7Y8OvOM5iIBCu2x8I vVhYv9ceBzAloaZti0ZR28TAbawCf0sDSZQ+SKbhXcsSD6voW89IKVLc8F8lCGAw8NI+ HNxeSZmHRnaeCbL+mLBZWicLN25OsC3R5u5Bycb7dxcW3vPLJlecCryL0hqNy6EzBcaA DXfQ== X-Gm-Message-State: AHYfb5jSkqSHNMWpE2VtY2SsuvvmRzTKS1BTi6WWvIawvYlLt67jUyzr /hcVRldjiOMoIT8FUtLQzEdt+L3ndQ== X-Received: by 10.200.56.184 with SMTP id f53mr32974887qtc.153.1502728746634; Mon, 14 Aug 2017 09:39:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.102.41 with HTTP; Mon, 14 Aug 2017 09:39:06 -0700 (PDT) In-Reply-To: References: From: Jeff Janes Date: Mon, 14 Aug 2017 09:39:06 -0700 Message-ID: Subject: Re: performance problem on big tables To: Mariel Cherkassky Cc: "pgsql-performance@postgresql.org" Content-Type: multipart/alternative; boundary="001a114368b62314a60556b94d39" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --001a114368b62314a60556b94d39 Content-Type: text/plain; charset="UTF-8" On Mon, Aug 14, 2017 at 6:24 AM, Mariel Cherkassky < mariel.cherkassky@gmail.com> wrote: > I have performance issues with two big tables. Those tables are located on > an oracle remote database. I'm running the quert : insert into > local_postgresql_table select * from oracle_remote_table. > > The first table has 45M records and its size is 23G. The import of the > data from the oracle remote database is taking 1 hour and 38 minutes. > To investigate this, I'd decouple the two steps and see how long each one takes: \copy (select * from oracle_remote_table) to /tmp/tmp with binary \copy local_postresql_table from /tmp/tmp with binary Cheers, Jeff --001a114368b62314a60556b94d39 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On M= on, Aug 14, 2017 at 6:24 AM, Mariel Cherkassky <mariel.cherkassk= y@gmail.com> wrote:

I have performa= nce issues with two big tables. Those tables are located on an oracle remot= e database. I'm running the quert :=C2=A0insert into local_postgresql_ta= ble select * from oracle_remote_table.

The first table has 45M records and its size is 23G= . The import of the data from the oracle remote database is taking 1 hour a= nd 38 minutes.

To investigate this, I'd deco= uple the two steps and see how long each one takes:

\copy (select * from oracle_remote_table) to /tmp/tmp with binary
\copy local_postresql_table from /tmp/tmp with binary

Cheers,

Jeff
--001a114368b62314a60556b94d39--