Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkulo-0007LL-J4 for pgsql-performance@arkaria.postgresql.org; Thu, 24 Aug 2017 16:14:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dkulo-0001GB-2H for pgsql-performance@arkaria.postgresql.org; Thu, 24 Aug 2017 16:14:12 +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 1dkuln-0001Ft-6K for pgsql-performance@postgresql.org; Thu, 24 Aug 2017 16:14:11 +0000 Received: from mail-it0-x233.google.com ([2607:f8b0:4001:c0b::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dkulj-0000d3-BR for pgsql-performance@postgresql.org; Thu, 24 Aug 2017 16:14:09 +0000 Received: by mail-it0-x233.google.com with SMTP id 13so5118565itx.0 for ; Thu, 24 Aug 2017 09:14:06 -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=UVgDHDtDlA8uULIbRGh8PRuh/nePCyzB6QgUIM1Od2g=; b=Xc6MDzWBHH0TskfxngfBputStY9Sp7jl46pqcBMdpB2qooKu46r6FshHsMRS0G4Uw4 zJSRWAsuMDOkTwB/veOQUajK/WQbQWL+Xc0bMtntno/tQfFWYqCatrzxBoFCFUarn8i4 qox378Q/RKzKkYaOmil2tcOzh42kJ8+Wfhc2bDZhrFrqJ2QuLHCR+0aYsz8gl8LJMfRj WbGXf2kNFuGRfMY92fiQ37YyXA71vZtm9fWJro3fIF8IE6+/U2CIscMaIIliK2cLfxxN Yzt2y+tt95JUBaW4fsxXSJjJyxF9ah05w2Hdrc+jsRHYXFjeKSR4k6/W2YMqQTIVi/Fa gqUw== 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=UVgDHDtDlA8uULIbRGh8PRuh/nePCyzB6QgUIM1Od2g=; b=dICM5voqzOsFjLmYMP9kXYRNMyD5a/sT4OIqqYMVW3qMR3obXQr3MMeBZJ4/RUdUxR Ory5y6gJpJOecpjQkubdMFEGCX1oz6SXdeNoJwsAh4SQ+SWC6Om3HI3j85FPhkRpqgme ocxpJ8DzU474TPbaCOsjdSmFue8sJ0uIDfzRYfe1uzQZqkOdHYuGAa/tQULXUBDLrwLu SOszujS2I0X3jXhX36wB0+7HfEymEPAGED64B+Mv7XuyE6QRpJhy3oRlPOer2zoa0Fr+ 4S/4Aw/655r7m1k66ZMTWZn6sE2cjbxmPLvNrcEoAtzhYBCWVGJB2cw9Twmhp85T2vOF N+Cg== X-Gm-Message-State: AHYfb5jqn8vb4LiHuRuR0TfrWSzgcym3/LVWC3+BA2VGE0Gj990y0axI M3V+g+k2I5mcriOfhtdi0GFTgzMNzw== X-Received: by 10.36.33.72 with SMTP id e69mr6004503ita.90.1503591246397; Thu, 24 Aug 2017 09:14:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.40.213 with HTTP; Thu, 24 Aug 2017 09:14:05 -0700 (PDT) In-Reply-To: References: <88350892-C4AB-4191-9F8E-DB7CFA81F6C6@gmail.com> <00990FBB-D288-4878-8B8E-36E24F808F2C@gmail.com> From: Claudio Freire Date: Thu, 24 Aug 2017 13:14:05 -0300 Message-ID: Subject: Re: performance problem on big tables To: Mariel Cherkassky Cc: "pgsql-performance@postgresql.org" Content-Type: text/plain; charset="UTF-8" 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 On Thu, Aug 24, 2017 at 4:51 AM, Mariel Cherkassky wrote: > Hi Claudio, how can I do that ? Can you explain me what is this option ? > > 2017-08-24 2:15 GMT+03:00 Claudio Freire : >> >> On Mon, Aug 21, 2017 at 5:00 AM, Mariel Cherkassky >> wrote: >> > To summarize, I still have performance problems. My current situation : >> > >> > I'm trying to copy the data of many tables in the oracle database into >> > my >> > postgresql tables. I'm doing so by running insert into >> > local_postgresql_temp >> > select * from remote_oracle_table. The performance of this operation are >> > very slow and I tried to check the reason for that and mybe choose a >> > different alternative. >> > >> > 1)First method - Insert into local_postgresql_table select * from >> > remote_oracle_table this generated total disk write of 7 M/s and actual >> > disk >> > write of 4 M/s(iotop). For 32G table it took me 2 hours and 30 minutes. >> > >> > 2)second method - copy (select * from oracle_remote_table) to /tmp/dump >> > generates total disk write of 4 M/s and actuval disk write of 100 K/s. >> > The >> > copy utility suppose to be very fast but it seems very slow. >> >> Have you tried increasing the prefetch option in the remote table? >> >> If you left it in its default, latency could be hurting your ability >> to saturate the network. > > Please don't top-post. I'm assuming you're using this: http://laurenz.github.io/oracle_fdw/ If you check the docs, you'll see this: https://github.com/laurenz/oracle_fdw#foreign-table-options So I'm guessing you could: ALTER FOREIGN TABLE remote_table OPTIONS ( SET prefetch 10240 ); -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance