Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 8D8B19FB2C9 for ; Mon, 5 Feb 2007 16:22:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 99969-06 for ; Mon, 5 Feb 2007 16:22:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 21AE79FA50C for ; Mon, 5 Feb 2007 16:22:18 -0400 (AST) Received: (qmail 26400 invoked by uid 500); 5 Feb 2007 20:22:09 -0000 Date: Mon, 5 Feb 2007 14:22:09 -0600 From: Bruno Wolff III To: Mark Stosberg Cc: pgsql-performance@postgresql.org Subject: Re: optimizing a geo_distance() proximity query Message-ID: <20070205202209.GA20382@wolff.to> Mail-Followup-To: Bruno Wolff III , Mark Stosberg , pgsql-performance@postgresql.org References: <20070204051644.GA3754@wolff.to> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/51 X-Sequence-Number: 23105 On Mon, Feb 05, 2007 at 14:47:25 -0500, Mark Stosberg wrote: > > This is also interesting. Is this approach practical if I want to index > what's near each of about 40,000 US zipcodes, or the approach mostly > useful if you there are just a small number of fixed points to address? I think the answer depends on what your data model is. If you treat each zip code as having a location at a single point, the earth distance stuff should work. If you are trying to include the shape of each zip code in your model and measure distances to the nearest point of zip codes, then you will probably be better off using postgis.