[mapserver-users] Create Index Multikeys in Postgresql

Frédérique Boyer Frédérique Boyer
Fri, 18 Oct 2002 14:15:41 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0041_01C276B0.D75CCCA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi list,

I have a table of roads in postgres with 3000000 lines.

I want to create a layer based on the lines with the attribut =
"roads.fonction =3D 'A'" or "roads.fonction=3D'B'".

The part of the .map file is :=20

   LAYER
      TYPE LINE
      STATUS DEFAULT
      CONNECTIONTYPE postgis
      CONNECTION "user=3Dpostgres  dbname=3Dtest0 host=3Dlocalhost =
port=3D5432"
      DATA "the_geom from roads"
      FILTER "(fonction=3D'A' or fonction=3D'B')"
      CLASS
         etc...
      END
   END

I have created two indexes on the table :
 1) CREATE INDEX roads_geom ON roads USING GIST ( the_geom =
gist_geometry_ops);
 2) CREATE INDEX "fonction_roads_key" ON "roads" USING RTREE =
("fonction");

I think the second index is not used. And I'd like to create a new index =
with these two fields concatenated, but I don't know how to do with this =
particular syntaxe.


Thanks
Frederique Boyer

------=_NextPart_000_0041_01C276B0.D75CCCA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi list,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have a table of roads in postgres =
with=20
3000000&nbsp;lines.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I want to create a layer based on the =
lines with=20
the attribut "roads.fonction =3D 'A'" or =
"roads.fonction=3D'B'".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The part of the .map file is : =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;=20
LAYER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE=20
LINE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STATUS=20
DEFAULT<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTIONTYPE=20
postgis<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTION =
"user=3Dpostgres&nbsp;=20
dbname=3Dtest0 host=3Dlocalhost =
port=3D5432"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATA=20
"the_geom from roads</FONT><FONT face=3DArial=20
size=3D2>"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FILTER "(fonction=3D'A' or=20
fonction=3D'B')"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
CLASS</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
etc...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; END<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have created two indexes on the table =

:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;1) CREATE INDEX roads_geom =
ON&nbsp;roads=20
USING GIST ( the_geom gist_geometry_ops);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;2) CREATE INDEX =
"fonction_roads_key" ON=20
"roads" USING RTREE ("fonction");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think the second index is not used. =
And I'd like=20
to create a new index with these two fields concatenated, but I don't =
know how=20
to do with this particular syntaxe.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Frederique =
Boyer</FONT></DIV></BODY></HTML>

------=_NextPart_000_0041_01C276B0.D75CCCA0--

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users