Re: [postgis-users] No index usage on geography query plan?

2010-06-01 Thread Paul Ramsey
It's mostly a matter of being globally careful about not reading things into memory that you don't need. For 2.0 we're just going to use the new index structure, so the 2D index will use the same machinery as the geography index. P. On Tue, Jun 1, 2010 at 12:03 PM, Martin Davis wrote: > > > Paul

Re: [postgis-users] No index usage on geography query plan?

2010-06-01 Thread Martin Davis
Paul Ramsey wrote: FYI, it is not the index that is slower, it is the op. The index is actually (surprisingly) faster. Wow, that's unexpected. Do you know why this is? Is there a message there for the current 2D GIST index? -- Martin Davis Senior Technical Architect Refractions Research,

Re: [postgis-users] No index usage on geography query plan?

2010-06-01 Thread Paul Ramsey
Bounding cube you mean? Could do. The problem with that is, it turns out that computing the bounding cube is actually the most computationally intensive part of the geography code! So we don't really want to do that for every edge of a shape. My approach is to use "bounding circles" for each edge.

Re: [postgis-users] No index usage on geography query plan?

2010-06-01 Thread Martin Davis
Perhaps it could use an in-memory bounding prism index? You're using a disk-based one used for geography types, right? Paul Ramsey wrote: On Mon, May 31, 2010 at 10:27 PM, Paragon Corporation wrote: On that thought. Remember how geometry intersects performance significantly increased wi

Re: [postgis-users] No index usage on geography query plan?

2010-06-01 Thread Paul Ramsey
On Mon, May 31, 2010 at 10:27 PM, Paragon Corporation wrote: > On that thought.  Remember how geometry intersects performance significantly > increased with prepared geometry algorithm, are we using that same kind of > prepared geometry logic for geography. No, we are not. The algorithm is curre

Re: [postgis-users] No index usage on geography query plan?

2010-05-31 Thread Nicholas Bower
- > *From:* postgis-users-boun...@postgis.refractions.net [mailto: > postgis-users-boun...@postgis.refractions.net] *On Behalf Of *Paul Ramsey > *Sent:* Monday, May 31, 2010 9:20 PM > > *To:* PostGIS Users Discussion > *Subject:* Re: [postgis-users] No index usage on geography

Re: [postgis-users] No index usage on geography query plan?

2010-05-31 Thread Paragon Corporation
Ramsey Sent: Monday, May 31, 2010 9:20 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] No index usage on geography query plan? FYI, it is not the index that is slower, it is the op. The index is actually (surprisingly) faster. P On May 31, 2010, at 5:06 PM, Nicholas Bower wrote

Re: [postgis-users] No index usage on geography query plan?

2010-05-31 Thread Paul Ramsey
rom: postgis-users-boun...@postgis.refractions.net > [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Nicholas > Bower > Sent: Sunday, May 30, 2010 7:38 PM > To: PostGIS Users Discussion > Subject: Re: [postgis-users] No index usage on geography query plan? > >

Re: [postgis-users] No index usage on geography query plan?

2010-05-31 Thread Nicholas Bower
oun...@postgis.refractions.net > > [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of > Nicholas > > Bower > > Sent: Sunday, May 30, 2010 7:38 PM > > To: PostGIS Users Discussion > > Subject: Re: [postgis-users] No index usage on geography query pla

Re: [postgis-users] No index usage on geography query plan?

2010-05-31 Thread Paul Ramsey
t; > > > From: postgis-users-boun...@postgis.refractions.net > [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Nicholas > Bower > Sent: Sunday, May 30, 2010 7:38 PM > To: PostGIS Users Discussion > Subject: Re: [postgis-users]

Re: [postgis-users] No index usage on geography query plan?

2010-05-31 Thread Paragon Corporation
Sent: Sunday, May 30, 2010 7:38 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] No index usage on geography query plan? Well the index says it is being used, however I'm still quite suspicious because of performance results below. I attach 3 versions of a simply query (

Re: [postgis-users] No index usage on geography query plan?

2010-05-30 Thread Nicholas Bower
Well the index says it is being used, however I'm still quite suspicious because of performance results below. I attach 3 versions of a simply query (Geography ST_Intersects, Geometry ST_Intersects, Geography &&) which is a simple square ROI intersection over 150k rows, each having a single polygo

Re: [postgis-users] No index usage on geography query plan?

2010-05-27 Thread Paragon Corporation
o: PostGIS Users Discussion Subject: Re: [postgis-users] No index usage on geography query plan? Right you are. wastac=> explain analyze select count(*) from wastac.t_tile_geometry where border && ST_GeographyFromText('SRID=4326;POLYGON((116.751709 -31.381779,116.883545 -32.676373

Re: [postgis-users] No index usage on geography query plan?

2010-05-27 Thread Nicholas Bower
ID=4326;POLYGON((116.751709 -31.381779,116.883545 > -32.676373,114.741211 -32.796510,114.796143-31.316101,116.751709 > -31.381779))')); > > Thanks > Regina and Leo > http://www.postgis.us > -- > *From:* postgis-users-boun...@postgis.refractions.net [mailto: > postgi

Re: [postgis-users] No index usage on geography query plan?

2010-05-27 Thread Mark Cave-Ayland
Paragon Corporation wrote: Nick, Okay we are seeing the same issue with our fastfoods data even with smaller windows. I think the clue is the plan here. The ST_Intersects geography function seems to be treated as a blackbox rather than a transparent function composed of && and _ST_Distance

Re: [postgis-users] No index usage on geography query plan?

2010-05-27 Thread Mark Cave-Ayland
Paragon Corporation wrote: Mark, He did include it in an earlier email wastac=> explain analyze select count(*) from wastac.t_tile_geometry where ST_Intersects(border, ST_GeographyFromText('SRID=4326;POLYGON((116.751709 -31.381779,116.883545 -32.676373,114.741211 -32.796510,114.796143 -31.3161

Re: [postgis-users] No index usage on geography query plan?

2010-05-26 Thread Paragon Corporation
et] On Behalf Of Nicholas Bower Sent: Wednesday, May 26, 2010 6:42 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] No index usage on geography query plan? That does look like a pretty huge bounding polygon, but the geography we agree should still be using the spatial index, so prob

Re: [postgis-users] No index usage on geography query plan?

2010-05-26 Thread Nicholas Bower
> That does look like a pretty huge bounding polygon, but the geography we > agree should still be using the spatial index, so probably making the index > cost higher than it should > Fyi the border values are are simply composed of a regular 20km grid of ajoining polygon squares covering Australi

Re: [postgis-users] No index usage on geography query plan?

2010-05-26 Thread Paragon Corporation
//www.postgis.us -Original Message- From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark Cave-Ayland Sent: Wednesday, May 26, 2010 8:44 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] No index usage on geograp

Re: [postgis-users] No index usage on geography query plan?

2010-05-26 Thread Mark Cave-Ayland
Nick Bower wrote: Try making a copy of your wastac.t_tile_geometry_old table but with a geography instead of geometry column for border, and you should see an improvement. That's precisely what I showed in the original post - geography intersecting geography column. See the table def. I was

Re: [postgis-users] No index usage on geography query plan?

2010-05-26 Thread Nick Bower
Try making a copy of your wastac.t_tile_geometry_old table but with a geography instead of geometry column for border, and you should see an improvement. That's precisely what I showed in the original post - geography intersecting geography column. See the table def. I was outlining in

Re: [postgis-users] No index usage on geography query plan?

2010-05-26 Thread Mark Cave-Ayland
Nicholas Bower wrote: But simply swapping the query region above from geometry to geography we're back to no index usage, explain analyze select count(*) from wastac.t_tile_geometry_old where ST_Intersects(border, ST_GeographyFromText('SRID=4316;POLYGON((116.751709 -31.381779,116.883545 -32

Re: [postgis-users] No index usage on geography query plan?

2010-05-25 Thread Nicholas Bower
> > What does the output of: > > SELECT version(), postgis_full_version(); > > return? > PostgreSQL 8.4.3 on x86_64-pc-solaris2.10, compiled by GCC gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath), 64-bit | POSTGIS="1.5.1" GEOS="3.2.1-CAPI-1.6.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.6.2

Re: [postgis-users] No index usage on geography query plan?

2010-05-25 Thread Mark Cave-Ayland
Nicholas Bower wrote: Perhaps this makes it more obvious - 9s to query a table of just 1.3M rows with ST_Intersects and 20ms using &&. explain analyze select count(*) from wastac.t_tile_geometry where ST_Intersects(border, ST_GeographyFromText('SRID=4326;POLYGON((116.751709 -31.381779,116.8

Re: [postgis-users] No index usage on geography query plan?

2010-05-25 Thread Nicholas Bower
Perhaps this makes it more obvious - 9s to query a table of just 1.3M rows with ST_Intersects and 20ms using &&. explain analyze select count(*) from wastac.t_tile_geometry where ST_Intersects(border, ST_GeographyFromText('SRID=4326;POLYGON((116.751709 -31.381779,116.883545 -32.676373,114.741211 -

Re: [postgis-users] No index usage on geography query plan?

2010-05-25 Thread Nicholas Bower
On 25 May 2010 22:35, Mark Cave-Ayland wrote: > Nicholas Bower wrote: > > Neither of the ST_Intersects clauses below invoke index usage according to >> explain output, despite docs saying they should automatically be doing bbox >> on the index; >> > > (cut) > > > What's going on - the difference

Re: [postgis-users] No index usage on geography query plan?

2010-05-25 Thread Mark Cave-Ayland
Nicholas Bower wrote: Neither of the ST_Intersects clauses below invoke index usage according to explain output, despite docs saying they should automatically be doing bbox on the index; (cut) What's going on - the difference in total cost above proves to me the indexes are not being used.

[postgis-users] No index usage on geography query plan?

2010-05-25 Thread Nicholas Bower
Neither of the ST_Intersects clauses below invoke index usage according to explain output, despite docs saying they should automatically be doing bbox on the index; explain analyze SELECT wastac.t_swath_metadata.swath_id AS wastac_t_swath_metadata_swath_id FROM wastac.t_swath_metadata JOIN wast