Hello again...<br>The problem is not the expressions ... I took off them and the problem continue ....<br><br>I believe is a problem with my sql :<br> _layer.data = "the_geom from (select count(def.descproblem) as number, 
def.descproblem, tg.city, lm.geocode, lm.the_geom from tblTower tg<br> inner join tblInsp on (tg.numgeraltower = i2.numgeraltower and tg.idlt = i2.idlt)<br> inner join tblProblens def  on ( i2.idproblem = def.idproblem and 
i2.idlt = def.idlt)<br> inner join limit_city lm on (upper(<a href="http://lm.name">lm.name</a>) = upper(tg.city) and upper(lm.uf) = upper(tg.estate))<br> where def.descproblem = 'PROBLEM DETECTED' and i2.datemanutencao BETWEEN '2005-01-01' AND '2006-11-30'
<br> group by def.descproblem, tg.city, lm.geocode, lm.the_geom<br> order by number) as thematic using unique geocode using srid=-1";<br><br>Any idea?<br><blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">

<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b> <a title="pauljame@GMAIL.COM" href="mailto:pauljame@GMAIL.COM">Paul james</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="MAPSERVER-USERS@LISTS.UMN.EDU" href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">
MAPSERVER-USERS@LISTS.UMN.EDU</a> 
</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Thursday, December 07, 2006 4:21 
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> [UMN_MAPSERVER-USERS] Expression 
so slow ...</div>
<div><br></div>Hello guys!<br><br>I´m creating a POLYGON layer in mapscript (c#) 
with a lot of classes like that :<br><br>layerObj _layer = new 
layerObj(mapaObj);<br>_layer.classitem = "geocode";<br>....<br>while 
(_reader.Read()) <br>{<br>            _geo = 
Convert.ToInt32(_reader["geocode"]);<br>            _city = 
_reader["city"].ToString();<br>            <br>              classObj _class = 
new classObj(_layer);<br>            _class.name = __city; <br>            
_class.template = "dummy";<br>            <br>            
_class.setExpression(_geo.ToString());<br>           <br>            styleObj 
_style = new styleObj(_class);        <br>            
_style.color.setRGB(_num.Next(0, 255), _num.Next(0, 255), _num.Next(0, 
255));       <br>}<br><br>All works great, so I got a Themathic map (very fast - 
about 2secs)<br>The problem occurs when I started to aproximate to one new 
POLYGON (Zoomin). <br>Each zoom took more and more time (about 8-10secs) to draw 
the map. Its very strange... <br>Did I miss anything?<br><br>ps.: I´m using 
Mapserver 4.10, windows xp and C#<br><br>[]´s<br></blockquote><br>