X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 17ADF9DC941 for ; Sat, 11 Feb 2006 17:25:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14946-08 for ; Sat, 11 Feb 2006 17:25:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 464749DC95A for ; Sat, 11 Feb 2006 17:25:07 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 1D4D439840; Sat, 11 Feb 2006 21:24:54 +0000 (UTC) Received: (hashcash-sendmail, from uid 1001); Sat, 11 Feb 2006 15:24:53 -0600 Date: Sat, 11 Feb 2006 15:24:53 -0600 From: "Jim C. Nasby" To: Aaron Turner Cc: "Matthew T. O'Connor" , pgsql-performance@postgresql.org Subject: Re: 10+hrs vs 15min because of just one index Message-ID: <20060211212453.GT57845@pervasive.com> References: <1ca1c1410602100016p2b5fdcc4wbf45612d7efc5fdf@mail.gmail.com> <43ECC9BF.2030107@zeut.net> <1ca1c1410602100924s191e7cddo4bda80d8f8d7cb6d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ca1c1410602100924s191e7cddo4bda80d8f8d7cb6d@mail.gmail.com> X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060211:synfinatic@gmail.com::UCJOtsbjKwbHjCi8:00000000000000000 00000000000000000000000064RB X-Hashcash: 1:20:060211:matthew@zeut.net::68sdpmRnkM8n0QEj:00tpL X-Hashcash: 1:20:060211:pgsql-performance@postgresql.org::BjYLDtovlDTdVEe+:00000 0000000000000000000000000N2/ X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.104 required=5 tests=[AWL=0.104] X-Spam-Score: 0.104 X-Spam-Level: X-Archive-Number: 200602/131 X-Sequence-Number: 17117 On Fri, Feb 10, 2006 at 09:24:39AM -0800, Aaron Turner wrote: > On 2/10/06, Matthew T. O'Connor wrote: > > Aaron Turner wrote: > > > So I'm trying to figure out how to optimize my PG install (8.0.3) to > > > get better performance without dropping one of my indexes. > > > > What about something like this: > > > > begin; > > drop slow_index_name; > > update; > > create index slow_index_name; > > commit; > > vacuum; > > Right. That's exactly what I'm doing to get the update to occur in 15 > minutes. Unfortunately though, I'm basically at the point of every > time I insert/update into that table I have to drop the index which is > making my life very painful (having to de-dupe records in RAM in my > application is a lot faster but also more complicated/error prone). > > Basically, I need some way to optimize PG so that I don't have to drop > that index every time. > > Suggestions? I think you'll have a tough time making this faster; or I'm just not understanding the problem well enough. It's probably time to start thinking about re-architecting some things in the application so that you don't have to do this. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461