I tried reversing the test and I'm still having the same problem. Here is some information I got from pgadmin3 concerning my tables:<br><br>CREATE TABLE sf_quat_geopy<br>(<br> gid serial NOT NULL,<br> sf_quat_ numeric,<br>
sf_quat_id numeric,<br> ptype character varying(35),<br> name character varying(200),<br> liq character varying(8),<br> liq_source bigint,<br> area numeric,<br> perimeter numeric,<br> e00_centro numeric,<br> e00_centr1 numeric,<br>
the_geom geometry,<br> CONSTRAINT sf_quat_geopy_pkey PRIMARY KEY (gid),<br> CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),<br> CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),<br>
CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 32610)<br>)<br><br>CREATE INDEX sf_quat_geopy_key<br> ON sf_quat_geopy<br> USING btree<br> (ptype);<br><br>CREATE INDEX sf_quat_geopy_the_geom_gist<br> ON sf_quat_geopy<br>
USING gist<br> (the_geom);<br><br>CREATE TABLE sj_100k_geopy<br>(<br> gid serial NOT NULL,<br> sj_geol_ numeric,<br> sj_geol_id numeric,<br> ptype character varying(35),<br> name character varying(200),<br> area numeric,<br>
perimeter numeric,<br> e00_centro numeric,<br> e00_centr1 numeric,<br> the_geom geometry,<br> CONSTRAINT sj_100k_geopy_pkey PRIMARY KEY (gid),<br> CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),<br> CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),<br>
CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 32610)<br>)<br><br>CREATE INDEX sj_100k_geopy_ptype<br> ON sj_100k_geopy<br> USING btree<br> (ptype);<br><br>CREATE INDEX sj_100k_geopy_the_geom_gist<br> ON sj_100k_geopy<br>
USING gist<br> (the_geom);<br><br><br> Nested Loop (cost=0.00..8226.67 rows=4509 width=15085)<br> Join Filter: _st_intersects(geob.the_geom, geoq.the_geom)<br> -> Seq Scan on sj_100k_geopy geob (cost=0.00..993.00 rows=7407 width=6918)<br>
Filter: ((ptype)::text <> ALL ('{Qls,Qls?}'::text[]))<br> -> Index Scan using sf_quat_geopy_the_geom_gist on sf_quat_geopy geoq (cost=0.00..0.96 rows=1 width=8167)<br> Index Cond: (geob.the_geom && geoq.the_geom)<br>
Filter: ((geoq.ptype)::text <> ALL ('{br,br?}'::text[]))<br><br><br>