Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id E00A3634CA4 for ; Mon, 9 Nov 2009 11:33:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67125-02-6 for ; Mon, 9 Nov 2009 15:33:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f186.google.com (mail-iw0-f186.google.com [209.85.223.186]) by mail.postgresql.org (Postfix) with ESMTP id 01C786349FD for ; Mon, 9 Nov 2009 11:33:13 -0400 (AST) Received: by mail-iw0-f186.google.com with SMTP id 16so2285290iwn.29 for ; Mon, 09 Nov 2009 07:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ojHExHwUwV188KHUhCbxE21mFjtndEexqKgO/vdm238=; b=OOisW9yTa+T0M0fmdNDMBCgsdr8Gvjx0xzOfJFmQFLCdS/H3yGbWqzYoe9DjCS0w/c ewZl/tBJhnSctCn7FdZKYEqmLcxWuJWsXwc8extO0ZvfmyoOH6lBNQeYZT4opUBHVZ8l 81WAksqpdavHN8yPUc0tA5eo9+Y6cBUayqLOM= 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:content-transfer-encoding; b=XeF9pK9Itsn+i4qK6eho3B3rB7Ouea7lenjukDRTZTQwQdx4Wgme1ibZlzbx/p07VN U5usiTazPjP1PjiSFyN3GRmF+yddZ7RAwtlw3ZpdM8czek/Lv4BdsunXDM2OEd95LJq7 7V3iQbDw0r2msNHulzuIHhkY+aFB+L4CUGauk= MIME-Version: 1.0 Received: by 10.231.10.16 with SMTP id n16mr8177332ibn.24.1257780792630; Mon, 09 Nov 2009 07:33:12 -0800 (PST) In-Reply-To: <603c8f070911090422t52412697hf19b222a033f729@mail.gmail.com> References: <008801ca6021$c1cc7630$45656290$@com> <18869.1257650960@sss.pgh.pa.us> <009601ca6030$0e731440$2b593cc0$@com> <603c8f070911090422t52412697hf19b222a033f729@mail.gmail.com> Date: Mon, 9 Nov 2009 08:33:12 -0700 Message-ID: Subject: Re: CREATE TABLE slowing down significantly over time From: Scott Marlowe To: Robert Haas Cc: Aris Samad-Yahaya , Tom Lane , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/92 X-Sequence-Number: 36260 On Mon, Nov 9, 2009 at 5:22 AM, Robert Haas wrote: > On Sat, Nov 7, 2009 at 11:58 PM, Aris Samad-Yahaya > wrote: >> We vacuum analyze nightly, and vacuum normally ad-hoc (but we're going t= o >> schedule this weekly moving forward). >> >> Interesting pointer about system catalog bloat. I tried to vacuum full t= he >> system catalog tables (pg_*), and the performance for creating a single >> table manually improved dramatically (back to what it used to be), but a= s >> soon as I created the next schema, the performance went back down to the >> same level. >> >> So there's a clue there somewhere. Next I will try to vacuum full the en= tire >> database. > > You should really enable autovacuum. =A0You'll probably have to VACUUM > FULL and REINDEX to clean everything up, but after that autovacuum > should be MUCH more effective than a nightly vacuum run. =A0If you're > running some ancient Pg version where autovacuum is not enabled by > default, you should also consider upgrading. =A0There are a lot of > goodies (including performance enhancements) in newer versions. Also note that the argument that autovacuum chews up too much IO is moot now that you can set cost delay to 10 to 20 milliseconds. Unless you're running on the hairy edge of maximum IO at all times, autovac should be pretty much unnoticed.