<p>! i&#39;m doing a WFS GetFeature request with a polygon.<br>
 Usually everything is fine. <br>
but for one table a got a enconding error with my data. (my problem) and the mapserver&#39;s log give me this SQL :</p>
<p>select &quot;nom&quot;,&quot;adresse&quot;,&quot;postal&quot;,&quot;code&quot;,&quot;telephone&quot;,&quot;postal0&quot;,&quot;etab_code&quot;,&quot;etab_nom&quot;,&quot;rss_code&quot;,&quot;rss_nom&quot;,&quot;rls_code&quot;,&quot;rls_nom&quot;,&quot;clsc_code&quot;,&quot;clsc_nom&quot;,&quot;mun_code&quot;,&quot;mun_nom&quot;,&quot;longitude&quot;,&quot;latitude&quot;,&quot;sgs&quot;,&quot;hsld&quot;,&quot;clsc&quot;,&quot;pdi&quot;,&quot;pdp&quot;,&quot;pat&quot;,&quot;cj&quot;,&quot;sp&quot;,&quot;objectid&quot;,&quot;nom_commun&quot;,encode(ST_AsBinary(ST_Force_2D(&quot;geom_p&quot;),&#39;NDR&#39;),&#39;hex&#39;) as geom,&quot;objectid&quot; from msss_v_sgs_p where geom_p &amp;&amp; GeomFromText(&#39;POLYGON((-1100000 -23500,-1100000 2253500,1100000 2253500,1100000 -23500,-1100000 -23500))&#39;,find_srid(&#39;&#39;,&#39;msss_v_sgs_p&#39;,&#39;geom_p&#39;))</p>

<p>So my question, Why is mapserver does a spatial query with the layer&#39;s extent?<br>
 with a table of 2millions features, that,s very slow even with a spatial index</p>
<p>marc-andre trottier</p>