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 8BD939DC853 for ; Sat, 18 Mar 2006 04:52:16 -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 74146-10 for ; Sat, 18 Mar 2006 04:52:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by postgresql.org (Postfix) with ESMTP id 172AB9DC842 for ; Sat, 18 Mar 2006 04:52:06 -0400 (AST) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.13.4/8.13.4) with ESMTP id k2I8om9a010384; Sat, 18 Mar 2006 11:50:49 +0300 (MSK) Date: Sat, 18 Mar 2006 11:50:48 +0300 (MSK) From: Oleg Bartunov X-X-Sender: megera@ra.sai.msu.su To: Michael Fuhr cc: Tom Lane , Dan Harris , PostgreSQL Performance Subject: Re: Help optimizing a slow index scan In-Reply-To: <20060318052941.GA46733@winnie.fuhr.org> Message-ID: References: <4419DB50.10404@drivefaster.net> <441B1FC6.60001@drivefaster.net> <12823.1142656871@sss.pgh.pa.us> <20060318052941.GA46733@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.44 required=5 tests=[AWL=-0.039, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.44 X-Spam-Level: X-Archive-Number: 200603/302 X-Sequence-Number: 17739 I may be wrong but we in astronomy have several sky indexing schemes, which allows to effectively use classical btree index. See http://www.sai.msu.su/~megera/oddmuse/index.cgi/SkyPixelization for details. Sergei Koposov has developed Q3C contrib module for PostgreSQL 8.1+ and we use it with billiard size astronomical catalogs. Oleg On Fri, 17 Mar 2006, Michael Fuhr wrote: > On Fri, Mar 17, 2006 at 11:41:11PM -0500, Tom Lane wrote: >> Dan Harris writes: >>> Furthermore, by doing so, I am tying my queries directly to >>> "postgres-isms". One of the long term goals of this project is to be >>> able to fairly transparently support any ANSI SQL-compliant back end >>> with the same code base. >> >> Unfortunately, there isn't any portable or standard (not exactly the >> same thing ;-)) SQL functionality for dealing gracefully with >> two-dimensional searches, which is what your lat/long queries are. > > The OpenGIS Simple Features Specification[1] is a step in that > direction, no? PostGIS[2], MySQL[3], and Oracle Spatial[4] implement > to varying degrees. With PostGIS you do have to add non-standard > operators to a query's predicate to benefit from GiST indexes on > spatial columns, but the rest of the query can be straight out of > the SQL and OGC standards. > > [1] http://www.opengeospatial.org/docs/99-049.pdf > [2] http://www.postgis.org/ > [3] http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html > [4] http://www.oracle.com/technology/products/spatial/index.html > > Regards, Oleg _____________________________________________________________ Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru), Sternberg Astronomical Institute, Moscow University, Russia Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(495)939-16-83, +007(495)939-23-83