Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4D1C91337B61 for ; Sun, 17 Apr 2011 12:44:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 80364-04 for ; Sun, 17 Apr 2011 15:44:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ey0-f174.google.com (mail-ey0-f174.google.com [209.85.215.174]) by mail.postgresql.org (Postfix) with ESMTP id 6ACFC1337B43 for ; Sun, 17 Apr 2011 12:44:06 -0300 (ADT) Received: by eyx24 with SMTP id 24so1153656eyx.19 for ; Sun, 17 Apr 2011 08:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=jGMNvJuTU4UufHVi9wKVuYuWUhoWF2oelMppz/iH38U=; b=iCtXCU+xvr4M+JlgDwFJAf85IFhvRjaKAeNb/4KWK5lqYYr3cRDafDvTG1II+zxyI0 6umKw/05EIqhkZ+esPKG8HcnV86DEOPzO73Fjn4CmdVYGbaSWY9pKhA+fN5OfkhGME7d Bd8QYY6RS5RtkJVsCwEjVRpm40oYa276/7qn8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Blb4TcxjsiSbrM9dvDHH2iXtWIzjPGl5Nq6odTj55Ccn3CI4DdnaIEniIRH/twHi/B oqtAhk8sxFYnG49yali8FPZrrvP3CHHY2rSqGHj+f8C4AZvGPRzHsCFo6J5tKxkgCk7O Mleg5RtFaqS5OG99oj4YX0pDn14sc7ItUrlRI= MIME-Version: 1.0 Received: by 10.213.106.200 with SMTP id y8mr1706645ebo.67.1303055044513; Sun, 17 Apr 2011 08:44:04 -0700 (PDT) Received: by 10.213.25.139 with HTTP; Sun, 17 Apr 2011 08:44:04 -0700 (PDT) In-Reply-To: References: Date: Sun, 17 Apr 2011 09:44:04 -0600 Message-ID: Subject: Re: REINDEX takes half a day (and still not complete!) From: Scott Marlowe To: Phoenix Kiula Cc: Merlin Moncure , 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=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/229 X-Sequence-Number: 43291 On Sun, Apr 17, 2011 at 9:30 AM, Phoenix Kiula wrote: > Sorry, rejuvenating a thread that was basically unanswered. > > I closed the database for any kinds of access to focus on maintenance > operations, killed all earlier processes so that my maintenance is the > only stuff going on. > > REINDEX is still taking 3 hours -- and it is still not finished! > > Similarly, if I cancel the REINDEX and issue a VACUUM ANALYZE VERBOSE, > this too seems to just hang there on my big table. > > I changed the maintenance_work_men to 2GB for this operation. It's > highly worrisome -- the above slow times are with 2GB of my server > dedicated to Postgresql!!!! > > Surely this is not tenable for enterprise environments? I am on a > 64bit RedHat server with dual CPU Intel Woodcrest or whatever that was > called. Postgres is 8.2.9. > > How do DB folks do this with small maintenance windows? This is for a > very high traffic website so it's beginning to get embarrassing. > > Would appreciate any thoughts or pointers. Upgrade to something more modern than 8.2.x. Autovacuum was still very much in its infancy back then. 9.0 or higher is a good choice. What do iostat -xd 10 and vmstat 10 and top say about these processes when they're running. "It's taking a really long time and seems like it's hanging" tells us nothing useful. Your OS has tools to let you figure out what's bottlenecking your operations, so get familiar with them and let us know what they tell you. These are all suggestions I made before which you have now classified as "not answering your questions" so I'm getting a little tired of helping you when you don't seem interested in helping yourself. What are your vacuum and autovacuum costing values set to? Can you make vacuum and / or autovacuum more aggresive?