<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>PostGIS raster sadly doesn’t use the pyramids in the Tifs.  Or if it does no one told me.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>You should build raster overviews using the raster2pgsql –l switch. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a href="https://postgis.net/docs/using_raster_dataman.html#RT_Raster_Loader">https://postgis.net/docs/using_raster_dataman.html#RT_Raster_Loader</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><pre><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Doc example is this which builds a level 2 and 4 pyramid<o:p></o:p></span></pre><pre>raster2pgsql -I -C -e -Y -F -s 26986 -t 128x128  -l 2,4 bostonaerials2008/*.jpg aerials.boston | psql -U postgres -d gisdb -h localhost -p 5432<o:p></o:p></pre><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>QGIS knows how to use the overviews built that way and should be much faster to view in QGIS<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:black'>raster2pgsql -s 4326 -t 256x256 -C -I -F "d:\Temp\060 tiff\res\OCG_t1.tif" OCG_t1 -R| psql. </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Alex German<br><b>Sent:</b> Monday, December 12, 2022 11:34 PM<br><b>To:</b> PostGIS Users Discussion <postgis-users@lists.osgeo.org><br><b>Subject:</b> [postgis-users] Qgis + PostGis. Low operating speed.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>Hello everyone!</span><o:p></o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>I have a GeoTIFF. </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>I built the pyramids in an external file using GDAL </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>"gdaladdo d:\Temp\060 tiff\res\t1.tif -r lanczos -ro 2 4 8 16 32 64 128 256 512. </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>Uploaded to PostGIS using </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>raster2pgsql -s 4326 -t 256x256 -C -I -F "d:\Temp\060 tiff\res\OCG_t1.tif" OCG_t1 -R| psql. </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>The number of files is more than 1000. </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>When trying to load tables in QGis, the loading is very slow. </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;color:black'>At the same time, downloading to QGis from files is fast. Question. What is not configured correctly and how to speed up the download to Qgis from PostGIS?</span><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><p class=MsoNormal>Alex German<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div></div></div></div></div></div></body></html>