Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A0B7A133655C for ; Sat, 19 Mar 2011 00:07:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 25461-06 for ; Sat, 19 Mar 2011 03:07:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 51AE7133616B for ; Sat, 19 Mar 2011 00:07:33 -0300 (ADT) Received: by vws1 with SMTP id 1so4155385vws.19 for ; Fri, 18 Mar 2011 20:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=qJgdQ/rawQVTHtr3g3XDHI+CcNoaRW1RSlH2Iv5V2JU=; b=C0QXwKwUTEeM8nW+m7cz70kVR37iSD3BtzC4K9qhdtrdPtnsfHjBBqov/p6A29/G8t dJ62WR5vWKqVQPBYNeweczvV96bUn1t+7naiiYPEljKlUgo93BmCU4vBZEhfmvefvzti XUWOzygYir8q7g/IND/MbF7XTBBYgZz2jmvnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=h0pbvM0IBClT8KpGSl+z+MhvHIW1NzsUXA/4QtegvmDs+LU99LilWkc3BwXxmS7EXO JYb4k1z1+4NZUkirvKGojhDV6KUcXaNe0dMYzD87tZpbroU4f+NeBvC4ad8Y9AbsCkuw XNCGVBLbrniEprcIwnNzWq+P/46tKJIDNWONs= MIME-Version: 1.0 Received: by 10.52.161.105 with SMTP id xr9mr433631vdb.193.1300504053280; Fri, 18 Mar 2011 20:07:33 -0700 (PDT) Received: by 10.52.157.163 with HTTP; Fri, 18 Mar 2011 20:07:33 -0700 (PDT) Date: Sat, 19 Mar 2011 11:07:33 +0800 Message-ID: Subject: REINDEX takes half a day (and still not complete!) From: Phoenix Kiula To: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.589 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201103/228 X-Sequence-Number: 42907 I have a large table but not as large as the kind of numbers that get discussed on this list. It has 125 million rows. REINDEXing the table takes half a day, and it's still not finished. To write this post I did "SELECT COUNT(*)", and here's the output -- so long! select count(*) from links; count ----------- 125418191 (1 row) Time: 1270405.373 ms That's 1270 seconds! I suppose the vaccuum analyze is not doing its job? As you can see from settings below, I have autovacuum set to ON, and there's also a cronjob every 10 hours to do a manual vacuum analyze on this table, which is largest. PG is version 8.2.9. Any thoughts on what I can do to improve performance!? Below are my settings. max_connections = 300 shared_buffers = 500MB effective_cache_size = 1GB max_fsm_relations = 1500 max_fsm_pages = 950000 work_mem = 100MB temp_buffers = 4096 authentication_timeout = 10s ssl = off checkpoint_warning = 3600 random_page_cost = 1 autovacuum = on autovacuum_vacuum_cost_delay = 20 vacuum_cost_delay = 20 vacuum_cost_limit = 600 autovacuum_naptime = 10 stats_start_collector = on stats_row_level = on autovacuum_vacuum_threshold = 75 autovacuum_analyze_threshold = 25 autovacuum_analyze_scale_factor = 0.02 autovacuum_vacuum_scale_factor = 0.01 wal_buffers = 64 checkpoint_segments = 128 checkpoint_timeout = 900 fsync = on maintenance_work_mem = 512MB