Thread: index issues with generate_series.....or why this index os not working

index issues with generate_series.....or why this index os not working

From
"Rhys A.D. Stewart"
Date:
Greetings!!

I'm not sure why the query is not using the gist index in the table
base.parishes. Any suggestions?
______________________________________________
CREATE TABLE base.parishes
(
  gid serial NOT NULL,
  parish text,
  "COUNT" integer,
  "SUM_AREA" double precision,
  "SUM_ELECTO" double precision,
  the_geom geometry,
  CONSTRAINT parishes_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
  CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3448)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE base.parishes OWNER TO postgres;

-- Index: base.gfd7ir67uftyujrth7ji68t678jttyrdgd

-- DROP INDEX base.gfd7ir67uftyujrth7ji68t678jttyrdgd;

CREATE INDEX gfd7ir67uftyujrth7ji68t678jttyrdgd
  ON base.parishes
  USING gist
  (the_geom);
______________________________________________


The query:
______________________________________________
with mnme as (
    select generate_series(600000,840000,2) mn,     generate_series(610000,710000,2)me
    ),
points as
    (select st_makepoint(mn,me), parish from mnme inner join
base.parishes on
st_intersects(setsrid(st_makepoint(mn,me),3448),the_geom))

select * from points
______________________________________________