Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8D68963418E for ; Sun, 8 Nov 2009 01:31:05 -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 96741-04 for ; Sun, 8 Nov 2009 05:30:57 +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 B54EE6340D8 for ; Sun, 8 Nov 2009 01:30:57 -0400 (AST) Received: by iwn16 with SMTP id 16so1621742iwn.29 for ; Sat, 07 Nov 2009 21:30:56 -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; bh=VZkzaMQjE1Xc4RbxG/nx5MwKFTjrGtGEEw/KzsjtT7o=; b=ta6L6hBv+n4tXGgG8ipasbhhZJHuWv/by3Os5FFGINXrZqDDlHwb0pYFN3TV/uTdIB 93nG3YDHSdQ9h35KDwxot9lfJ37kKxL8BF4N4+zUsO4Yqxy4gKH/y3ozwKlRVITXd+W2 eRo2AL+e//Vo5P91ftxy8URflMyIEL3ZvrRxE= 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=c01fexxwP9aceyId3mtcqMDgHhHG0TwKfLPtawrQSjzh3TNQHtGkB2W9sf4B7tytdF 62AdTHggGjiLnwc+gC3IU6A70L+wjgIjEspE+TJfPXnCGjbnogRY45TKofCisz3ma/EA zRvjEMkVeDvnYtYHKYsQQCiUC+KV0/pOmN+uM= MIME-Version: 1.0 Received: by 10.231.25.29 with SMTP id x29mr5322570ibb.31.1257658256573; Sat, 07 Nov 2009 21:30:56 -0800 (PST) In-Reply-To: <009601ca6030$0e731440$2b593cc0$@com> References: <008801ca6021$c1cc7630$45656290$@com> <18869.1257650960@sss.pgh.pa.us> <009601ca6030$0e731440$2b593cc0$@com> Date: Sat, 7 Nov 2009 22:30:56 -0700 Message-ID: Subject: Re: CREATE TABLE slowing down significantly over time From: Scott Marlowe To: Aris Samad-Yahaya Cc: Tom Lane , 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.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/84 X-Sequence-Number: 36252 On Sat, Nov 7, 2009 at 9:58 PM, Aris Samad-Yahaya wrote: > We vacuum analyze nightly, and vacuum normally ad-hoc (but we're going to > schedule this weekly moving forward). > > Interesting pointer about system catalog bloat. I tried to vacuum full the > system catalog tables (pg_*), and the performance for creating a single > table manually improved dramatically (back to what it used to be), but as > 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 entire > database. If you don't run autovac, it's possible you've managed to bloat your pg_catalog tables... Note that we run similar numbers of tables, as we have 30 tables and about 10 indexes in over 2000 schemas. We did the trick Tom posted: alter function pg_table_is_visible(oid) cost 10; to get faster tab completion and / or \d performance.