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 B83579DCBA3 for ; Fri, 17 Mar 2006 13:37:08 -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 67881-03 for ; Fri, 17 Mar 2006 13:37:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 2D6E19DCBD4 for ; Fri, 17 Mar 2006 13:37:06 -0400 (AST) Received: (qmail 19734 invoked by uid 500); 17 Mar 2006 17:38:28 -0000 Date: Fri, 17 Mar 2006 11:38:27 -0600 From: Bruno Wolff III To: Dan Harris Cc: PostgreSQL Performance Subject: Re: Help optimizing a slow index scan Message-ID: <20060317173827.GB15967@wolff.to> Mail-Followup-To: Bruno Wolff III , Dan Harris , PostgreSQL Performance References: <4419DB50.10404@drivefaster.net> <4419DC1C.9070806@drivefaster.net> <684362e10603161915x431c6b08t@mail.gmail.com> <441AD702.9020508@drivefaster.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <441AD702.9020508@drivefaster.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.102 required=5 tests=[AWL=0.102] X-Spam-Score: 0.102 X-Spam-Level: X-Archive-Number: 200603/283 X-Sequence-Number: 17720 On Fri, Mar 17, 2006 at 08:34:26 -0700, Dan Harris wrote: > Markus Bertheau wrote: > >Have you tried using a GIST index on lat & long? These things are > >meant for two-dimensional data, whereas btree doesn't handle > >two-dimensional data that well. How many rows satisfy either of the > >long / lat condition? > > > > > >> > According to the analyze, less than 500 rows matched. I'll look into > GIST indexes, thanks for the feedback. Have you looked at using the Earth Distance contrib module? If a spherical model of the earth is suitable for your application, then it may work for you and might be easier than trying to create Gist indexes yourself.