Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLaag-00058K-3L for pgsql-performance@arkaria.postgresql.org; Mon, 16 Sep 2013 15:19:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VLaae-0001P4-AS for pgsql-performance@arkaria.postgresql.org; Mon, 16 Sep 2013 15:19:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLaad-0001Ol-4Z for pgsql-performance@postgresql.org; Mon, 16 Sep 2013 15:19:51 +0000 Received: from mail.trovaprezzi.it ([2.228.21.217]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLaaW-0003pM-AU for pgsql-performance@postgresql.org; Mon, 16 Sep 2013 15:19:50 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.trovaprezzi.it (Postfix) with ESMTP id 5B5FE82182; Mon, 16 Sep 2013 17:14:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.7pixel.local Received: from mail.trovaprezzi.it ([127.0.0.1]) by localhost (zimbra.7pixel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gvxOI62Ee5Bm; Mon, 16 Sep 2013 17:14:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.trovaprezzi.it (Postfix) with ESMTP id D864F82184; Mon, 16 Sep 2013 17:14:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.7pixel.local Received: from mail.trovaprezzi.it ([127.0.0.1]) by localhost (zimbra.7pixel.local [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kiZzoThFqVG0; Mon, 16 Sep 2013 17:14:09 +0200 (CEST) Received: from zimbra.7pixel.local (zimbra.7pixel.local [192.168.0.127]) by mail.trovaprezzi.it (Postfix) with ESMTP id EB13482182; Mon, 16 Sep 2013 17:14:09 +0200 (CEST) Date: Mon, 16 Sep 2013 17:14:09 +0200 (CEST) From: Roberto Grandi To: Jeff Janes Cc: pgsql-performance@postgresql.org, Kevin Grittner Message-ID: <1359287440.225063.1379344449924.JavaMail.root@trovaprezzi.it> In-Reply-To: References: <535715181.700956.1378223895627.JavaMail.root@trovaprezzi.it> <1378240470.79541.YahooMailNeo@web162905.mail.bf1.yahoo.com> <1680047223.718929.1378275308275.JavaMail.root@trovaprezzi.it> <2031102275.783807.1378397108337.JavaMail.root@trovaprezzi.it> <519968828.69982.1378966451438.JavaMail.root@trovaprezzi.it> Subject: Re: COPY TO and VACUUM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [91.204.80.113] X-Mailer: Zimbra 8.0.2_GA_5569 (ZimbraWebClient - FF23 (Win)/8.0.2_GA_5569) Thread-Topic: COPY TO and VACUUM Thread-Index: UR+SxYz8jKXICqjoolyfIWLKx7zLoQ== X-Pg-Spam-Score: -2.6 (--) 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 Hi Jeff, thanks for your suggestion, Well test Vacuum instead of Cluster and come ba= ck with live result. at the same time i discovered that our COPY (...) TO are really really slow= , I see 0Kb a t the beginning but at the end they grow by 4Kb each second. Our export is standard (i.e.: SELECT a, b, c FROM table1) but sometime it's= very slow, what could be your suggestion? Is it possible to detect if we a= re facing problem on IO or Linux systemItself? Many thank in advance for all your help. Regards, Roberto ----- Messaggio originale ----- Da: "Jeff Janes" A: "Roberto Grandi" Cc: pgsql-performance@postgresql.org, "Kevin Grittner" Inviato: Luned=C3=AC, 16 settembre 2013 2:18:44 Oggetto: Re: [PERFORM] COPY TO and VACUUM On Wed, Sep 11, 2013 at 11:14 PM, Roberto Grandi < roberto.grandi@trovaprezzi.it> wrote: > Hi Guys, > > we found a suitable solution for our process we run every 5-6 hours a > CLUSTER stement for our big table: this "lock" activities but allow us to > recover all available space. > If you can tolerate the locks, that is fine, but it just doesn't seem like this should be necessary. A manual vacuum should get the job done with weaker locking. Did you try running a manual vacuum every 5-6 hours instead (it would probably not reclaim the space, but would make it available for reuse and so cap the steady-state size of the file, hopefully to about the same size as the max size under the CLUSTER regime) > When testing this task we discover another issues and that's why I'm > coming back to you for your experience: > > duting our process we run multiple simoultaneously "COPY... FROM" in order > to load data into our table but a t the same time we run also "COPY ... T= O" > statement in parallel to export data for other clients. > > We found that COPY .. TO queries sometimes are pending for more than 100 > minutes and the destination file continues to be at 0 Kb. Can you advise = me > how to solve this issue? > Are your COPY ... FROM also blocking, just in a way you are not detecting (because there is no growing file to watch the size of)? What does pg_lock say? Cheers, Jeff --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance