X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 728059FA163 for ; Fri, 30 Jun 2006 11:36:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 11521-09 for ; Fri, 30 Jun 2006 11:36:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.libertyrms.com (vgateway.libertyrms.info [207.219.45.62]) by postgresql.org (Postfix) with ESMTP id 3394B9FA5E9 for ; Fri, 30 Jun 2006 11:36:06 -0300 (ADT) Received: from dba5.int.libertyrms.com ([10.1.3.44]) by mail.libertyrms.com with esmtp (Exim 4.22) id 1FwK6G-0005D3-Gj; Fri, 30 Jun 2006 10:36:04 -0400 Message-ID: <44A536D3.10601@ca.afilias.info> Date: Fri, 30 Jun 2006 10:36:03 -0400 From: Brad Nicholson User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: Ksenia Marasanova CC: pgsql-performance@postgresql.org Subject: Re: newly created database makes queries run 300% faster References: <130df1930606300713y55496692l3ee844f055305aa8@mail.gmail.com> In-Reply-To: <130df1930606300713y55496692l3ee844f055305aa8@mail.gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: bnichols@ca.afilias.info X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/497 X-Sequence-Number: 19854 Ksenia Marasanova wrote: > Hi, > > Alfter hours of adjusting performance of the queries in my Postgres > 7.3 database - reprogramming the queries, VACUUMing, changing value of > enable_seqscan - I gived it up, recreated the database and transferred > the dump of the old database into it. > The queries went from 15 sec to 50 msec!! Wow. > Now I would really love to know how the old database got that slow, > and how can I avoid it in the future. Any tips are greatly > appreciated! If memory servers me (and it might not in this case), vacuum in 7.3 had issues with indexes. Reindexing or clustering your tables might have helped. Both are blocking operations. How to avoid it in the future is simple. Upgrade to a modern version of Postgres and vacuum your database properly. People work on this thing for a reason :-) -- Brad Nicholson 416-673-4106 Database Administrator, Afilias Canada Corp.