Hi Ivan,<div><br></div><div>the pyramid levels in Oracle are not exactly the same as the zoom levels in MapServer... Each level whould have 1/4 number of pixels as the previous level...ie: X/2*Y/2</div><div><br></div><div>

<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">The size of the pyramid image at each level is determined by the original image size and the pyramid level, according to the following formulas:<pre style="white-space: pre-wrap; ">

r(n) = (int)(r(0) / 2^n)<br>c(n) = (int)(c(0) / 2^n)</pre></span></div><div><br></div><div>In my case I have generated all the possible levels of pyramids... The Idea of generating the pyramids is to speeding up the zoomed out images.. ie: if you want to display the whole UK, you do not need to get the 100kx160k pixels... you can read an upper level in the pyramid reading only 1kx1k pixels... in the same way, if you need to do a zoom in at street level, you can read from the level 0, that means reading the maximum resolution and it is fast as you read only a fraction of the whole image...</div>

<div><br></div><div>with MapViewer+GDAL it getting very slow when generating tiles at street level .... it should not be.... at that point you do not need pyramid any more...</div><div><br></div><div>If I didn&#39;t have created pyramids, it still would be fast at street level but it would be very slow at city level and it would be impossible to display at country level...</div>

<div><br></div><div>does it make sense ?</div><div><br><div class="gmail_quote">On Fri, Aug 13, 2010 at 6:57 PM, Ivan Lucena <span dir="ltr">&lt;<a href="mailto:ivan.lucena@pmldnet.com">ivan.lucena@pmldnet.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Sebastian,<br>
<div class="im"><br>
You said:<br>
<br>
&gt; yep I did... and the weir thing is that generating the images from &quot;far<br>
&gt; away&quot; zoom under 12... it performs very well... not sure why it doesn&#39;t<br>
&gt; in the levels 13-17....  for that reason I was trying to find the SQL<br>
&gt; queries....<br>
<br>
</div>But your GeoRaster Pyramid level is &lt;maxLevel&gt;11&lt;/maxLevel&gt;<br>
<br>
By the size of you image you should have 20 level.<br>
<br>
Can you run sdo_geor.generatePyramid() again changing only the number of levels, keeping the same method. That should run faster, keeping the existing pyramid levels.<br>
<br>
Please let me know how it works now.<br>
<br>
Regards,<br>
<br>
Ivan<br>
<div class="im"><br>
&gt;  -------Original Message-------<br>
&gt;  From: Ivan Lucena &lt;<a href="mailto:ivan.lucena@pmldnet.com">ivan.lucena@pmldnet.com</a>&gt;<br>
&gt;  To: Sebastian E. Ovide &lt;<a href="mailto:sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt;<br>
&gt;  Cc: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt;  Subject: Re: [mapserver-users] logging GDAL queries<br>
</div><div><div></div><div class="h5">&gt;  Sent: Aug 13 &#39;10 11:16<br>
&gt;<br>
&gt;  Sebastian,<br>
&gt;<br>
&gt;  &gt;  -------Original Message-------<br>
&gt;  &gt;  From: Sebastian E. Ovide &lt;<a href="mailto:sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt;<br>
&gt;  &gt;  To: Ivan Lucena &lt;<a href="mailto:ivan.lucena@pmldnet.com">ivan.lucena@pmldnet.com</a>&gt;<br>
&gt;  &gt;  Cc: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt;  &gt;  Subject: Re: [mapserver-users] logging GDAL queries<br>
&gt;  &gt;  Sent: Aug 13 &#39;10 09:27<br>
&gt;  &gt;  <br>
&gt;  &gt;  On Fri, Aug 13, 2010 at 1:59 PM, Ivan Lucena &lt;[LINK:<br>
&gt;  &gt;  mailto:<a href="mailto:ivan.lucena@pmldnet.com">ivan.lucena@pmldnet.com</a>] <a href="mailto:ivan.lucena@pmldnet.com">ivan.lucena@pmldnet.com</a>&gt; wrote:<br>
&gt;  &gt;  Sebastian,<br>
&gt;  &gt;  <br>
&gt;  &gt;  You are using a very small block size, maybe because you are also using<br>
&gt;  &gt;  ArcGIS products and they only support Oracle GeoRaster with 256x256<br>
&gt;  &gt;  blocking. Is that right?<br>
&gt;  &gt;  <br>
&gt;  &gt;  <br>
&gt;  &gt;  nop... I guess that 256x256 if the default gdal_translate block size ?<br>
&gt;<br>
&gt;  That is the default on GDAL/GeoRaster driver but you can change it using -co BLOCKXSIZE and -co BLOCKYSIZE.<br>
&gt;<br>
&gt;  But that would require you to load the image again (and generate Pyramids again...)<br>
&gt;<br>
&gt;  &gt;   <br>
&gt;  &gt;  Because of that, to access your GeoRaster object, the GDAL driver is<br>
&gt;  &gt;  requesting a very large array of BLOB (1000000 approximately). That can<br>
&gt;  &gt;  make your sever such-up memory from the machine where it is running and it<br>
&gt;  &gt;  is probably using virtual memory (disk) what is really slow.<br>
&gt;  &gt;  <br>
&gt;  &gt;  do you mean where MapServer is running ?<br>
&gt;  &gt;  <br>
&gt;  &gt;  top - 14:41:31 up 7 days,  6:20, 10 users,  load average: 2.81, 1.92,<br>
&gt;  &gt;  1.20<br>
&gt;  &gt;  Tasks: 340 total,   2 running, 338 sleeping,   0 stopped,   0 zombie<br>
&gt;  &gt;  Cpu(s): 11.8%us, 10.4%sy,  7.7%ni, 62.1%id,  0.0%wa,  0.0%hi, <br>
&gt;  &gt;  8.0%si,  0.0%st<br>
&gt;  &gt;  Mem:  12331240k total,  5992136k used,  6339104k free,   189416k<br>
&gt;  &gt;  buffers<br>
&gt;  &gt;  Swap:  9084716k total,   703708k used,  8381008k free,  1481992k<br>
&gt;  &gt;  cached<br>
&gt;  &gt;  <br>
&gt;  &gt;    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+ <br>
&gt;  &gt;  COMMAND<br>
&gt;  &gt;  24850 www-data  20   0  533m 330m  18m R   14  2.7   0:00.94<br>
&gt;  &gt;  mapserv<br>
&gt;  &gt;  24852 www-data  20   0  532m 329m  18m S   19  2.7   0:01.22<br>
&gt;  &gt;  mapserv<br>
&gt;  &gt;  24849 www-data  20   0  529m 326m  18m S   16  2.7   0:01.00<br>
&gt;  &gt;  mapserv<br>
&gt;  &gt;  24851 www-data  20   0  517m 314m  18m S   13  2.6   0:00.96<br>
&gt;  &gt;  mapserv<br>
&gt;  &gt;  24853 www-data  20   0  499m 296m  18m S    8  2.5   0:00.75<br>
&gt;  &gt;  mapserv<br>
&gt;  &gt;  24854 www-data  20   0  470m 267m  18m S    5  2.2   0:00.53<br>
&gt;  &gt;  mapserv<br>
&gt;<br>
&gt;  Yeah. I am sorry. I called Mapserver a client :)<br>
&gt;<br>
&gt;  It is a Oracle client in that case. You probably have another nice machine running Oracle.<br>
&gt;<br>
&gt;  That is not the problem.<br>
&gt;<br>
&gt;  &gt;  <br>
&gt;  &gt;     It also uses some memory on the client side just to hold the array too<br>
&gt;  &gt;  but if you are running everything (Mapserver,Oracle) on the same machine<br>
&gt;  &gt;  that will adds up.<br>
&gt;  &gt;  <br>
&gt;  &gt;  <br>
&gt;  &gt;  Oracle is running on another Machine... and is very likely that it is the<br>
&gt;  &gt;  bottle neck...<br>
&gt;<br>
&gt;  Maybe not but I believe you have tools on Enterprise Manager to show the volume and speed of traffic.<br>
&gt;<br>
&gt;  &gt;  <br>
&gt;  &gt;  <br>
&gt;  &gt;  We are aware of that problem but it would be very helpful if you could<br>
&gt;  &gt;  file a bug report on GDAL&#39;s trac [[LINK: <a href="http://trac.osgeo.org/gdal/" target="_blank">http://trac.osgeo.org/gdal/</a>]<br>
&gt;  &gt;  <a href="http://trac.osgeo.org/gdal/" target="_blank">http://trac.osgeo.org/gdal/</a>] Thanks.<br>
&gt;  &gt;  <br>
&gt;  &gt;  <br>
&gt;  &gt;  I guess that the problem is that MapServer triys to read the whole map<br>
&gt;  &gt;  instead of reading only tile ???? is that correct ?<br>
&gt;  &gt;      Just as curiosity. Did you loaded that image with gdal_translate? How<br>
&gt;  &gt;  long it took and long does it takes to generate pyramids? Ha, you forgot to<br>
&gt;  &gt;  say what version of Oracle you are using.<br>
&gt;  &gt;  <br>
&gt;  &gt;  <br>
&gt;  &gt;  I loaded it with gdal in around 5 minutes... the pyramid (all levels) has<br>
&gt;  &gt;  been created overnight....<br>
&gt;<br>
&gt;  You original file was 51 Gb and it was loaded in 5 minutes !<br>
&gt;<br>
&gt;  See, forget all about network traffic. That is just great.<br>
&gt;<br>
&gt;  Note that it doesn&#39;t matter if you generate pyramids on PL/SQL or gdaladdo, the GDAL driver will call the same PL/SQL statement that you would write yourself.<br>
&gt;<br>
&gt;  So I believe that the problem is that Mapserver need to call GDALOpen() several times on that GeoRaster and that makes the GDAL driver to run the main-big-query several times. That needs to be addressed some how.<br>


&gt;<br>
&gt;  Regards,<br>
&gt;<br>
&gt;  Ivan<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt;  _______________________________________________<br>
&gt;  mapserver-users mailing list<br>
<div class="im">&gt;  <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
</div><div><div></div><div class="h5">&gt;  <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Sebastian E. Ovide<br><br><br><br><br>
</div>