Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 79C481337BD1 for ; Sat, 23 Apr 2011 16:44:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 19205-10 for ; Sat, 23 Apr 2011 19:43:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yi0-f46.google.com (mail-yi0-f46.google.com [209.85.218.46]) by mail.postgresql.org (Postfix) with ESMTP id 10D411337BD6 for ; Sat, 23 Apr 2011 16:43:46 -0300 (ADT) Received: by yia27 with SMTP id 27so359418yia.19 for ; Sat, 23 Apr 2011 12:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=RN/PYQJhRQyDAHubLxK2v0GVoV53fEPfwu9UjV4+o3o=; b=KL5lcleOuGivOkSJspE8rTjg3IXzzoONTha6XChV5GRYYo+LreXqIxr5D/w0rvzhlF LZRM9fJxwzIpizKPMuGhFx8uNnxTdqPnVkb45OQa0vXYCs9qG9xmNqMXzmW793IgVx32 LNBNOgWCOla7Kwuqq73yzgWmU9tFiCBvCxOT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=OMVgePghnPb/adAA3sOdIdx5I0ZGW57fZezRRAD/XfIIbyOiXlu6vUbQybbvFHI5Tt MD3JWMerjnop6uxyEmzlnoLg0Q6Z12i6XDk5zqKSRtCeQQfcWRaTIkydyd5eDBUQ9606 gJ5Pqs+NRdAsYqNTXwHc02V+Uf17R5eYYuQMw= Received: by 10.150.94.15 with SMTP id r15mr2074875ybb.393.1303587826443; Sat, 23 Apr 2011 12:43:46 -0700 (PDT) Received: from [10.4.195.72] ([198.228.194.51]) by mx.google.com with ESMTPS id f2sm1905727ybh.7.2011.04.23.12.43.43 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Apr 2011 12:43:45 -0700 (PDT) References: In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8A293) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <34CE0668-2A83-4BE4-B191-86871C2F8334@gmail.com> Cc: Merlin Moncure , "pgsql-performance@postgresql.org" X-Mailer: iPhone Mail (8A293) From: Robert Haas Subject: Re: REINDEX takes half a day (and still not complete!) Date: Sat, 23 Apr 2011 15:44:23 -0400 To: Phoenix Kiula X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.897 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, MIME_QP_LONG_LINE=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/335 X-Sequence-Number: 43397 On Apr 17, 2011, at 11:30 AM, Phoenix Kiula wrote:= > Sorry, rejuvenating a thread that was basically unanswered. >=20 > 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. >=20 > REINDEX is still taking 3 hours -- and it is still not finished! >=20 > Similarly, if I cancel the REINDEX and issue a VACUUM ANALYZE VERBOSE, > this too seems to just hang there on my big table. >=20 > 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!!!! >=20 > 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. >=20 > 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. >=20 > Would appreciate any thoughts or pointers. An upgrade would probably help you a lot, and as others have said it sounds l= ike your hardware is failing, so you probably want to deal with that first. I am a bit surprised, however, that no one seems to have mentioned using CLU= STER rather than VACUUM or REINDEX. Sometimes that's worth a try... ...Robert=