[postgis-users] GIST indexing behavior

Randy.Goss at kimley-horn.com Randy.Goss at kimley-horn.com
Fri May 24 07:00:42 PDT 2002


I have an example table that consists of a number of overlapping
polygons of various sizes. I am using this table to query features
inside of other features; for example, to find all of the features
inside of a feature called 'Hillsborough' I run the following query, and
receive the following results:

QUERY:
select name from florida where the_geom~(select the_geom from florida
where name='Hillsborough')

RESULTS:	
Plant City	
Tampa	
Temple Terrace	
Ruskin   	
Sun City Center	
Hillsborough	


Next, I create a GIST index on the geometry column using the following:

create index idx_geo on florida using GIST (the_geom GIST_GEOMETRY_OPS);

Re-running the original query now produces the following results:

RESULTS:
Hillsborough	

Why does the query return a single value on the indexed table?




More information about the postgis-users mailing list