<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">One question...<br><br>From a performance perspective, I would have thought that having the fliter<br> FILTER&nbsp; (stype='B' and uc='%vucv%')<br>inside the DATA statement SQL would be faster, as only the relevant records would be returned to mapserver, &amp; Postgres would be more efficient at doing this.<br><br>Is there any advantage in using FILTER instead of an SQL WHERE clause for this?<br><br>Brent Wood<br><br>--- On <b>Tue, 8/30/11, Julien Cigar <i>&lt;jcigar@ulb.ac.be&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Julien Cigar &lt;jcigar@ulb.ac.be&gt;<br>Subject: Re: [mapserver-users] Issue with run-time substitution?<br>To: mapserver-users@lists.osgeo.org<br>Date: Tuesday, August 30, 2011, 11:49 PM<br><br><div class="plainMail">On 08/30/2011 13:43, Stephen Davies
 wrote:<br>&gt; I am running mapserver 6.0.1 with map files migrated from 5.6.3.<br>&gt;<br>&gt; One of my map files has stopped working properly and I suspect that it may be a<br>&gt; bug in the 6.0.1 run-time substitution code.<br>&gt;<br>&gt; The relevant map file layer sections look like this:<br>&gt;<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;LAYER<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; CONNECTIONTYPE postgis<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; NAME "battery"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; DATA "geom from wmd&nbsp; using unique id using SRID=4283"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; CONNECTION "user=scldad dbname=benparts"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; STATUS ON<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; TYPE POINT<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; VALIDATION<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vucv '[0-9]*_[0-9]*'<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; END<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; FILTER&nbsp; (stype='B' and uc='%vucv%')<br>&gt;&nbsp; &nbsp; &nbsp;
 &nbsp; PROJECTION<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "init=epsg:4283"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; END<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; MAXSCALE 5000000<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; LABELITEM "label"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; CLASSITEM "state"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; CLASS<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXPRESSION "G"<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STYLE<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLOR&nbsp; &nbsp; &nbsp; &nbsp; 0 255 0<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SYMBOL 'dot'<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SIZE 7<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OFFSET 17 0<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LABEL<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; POSITION CR<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TYPE TRUETYPE<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FONT
 arial<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SIZE 8<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLOR 0 255 0<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OFFSET 20 0<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FORCE TRUE<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STYLE<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GEOMTRANSFORM 'labelpoly'<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLOR&nbsp;&nbsp;&nbsp;255 255 255<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; END<br>&gt; .<br>&gt; .<br>&gt; END<br>&gt;<br>&gt; There are twelve layers with essentially the same definition apart from the<br>&gt; STYPE values.<br>&gt;<br>&gt; The invoking URL has&amp;vucv=137_11 but the postgresql log reveals that no<br>&gt; substitution has occurred. The final pgsql command still has
 '%vucv%'.<br>&gt;<br>&gt; I suspect that having more than one FILTER with the same substitution breaks<br>&gt; things as all other substitutions work fine.<br>&gt;<br>&gt; (I also tried putting the substitution in the DATA entry but with no better<br>&gt; result.)<br><br>You should use a METADATA section, something like:<br><br>METADATA<br>&nbsp;&nbsp;&nbsp;"vucv_validation_pattern" '[0-9]*_[0-9]*'<br>END<br><br>instead of VALIDATION<br><br>&gt;<br>&gt; Cheers,<br>&gt; Stephen<br>&gt;<br><br><br>-- <br>No trees were killed in the creation of this message.<br>However, many electrons were terribly inconvenienced.<br></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a
 href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></blockquote></td></tr></table>