<div dir="ltr">actually, yes you have a spatial index : sidx_tuile_geom<br></div><br><div class="gmail_quote"><div dir="ltr">Le jeu. 6 déc. 2018 à 17:49, Manchon Pierre <<a href="mailto:pierre.manchon@irstea.fr">pierre.manchon@irstea.fr</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="FR" link="blue" vlink="purple"><div class="m_-8773099637063814945WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Ha yes it’s because it’s a screenshot from a SGBD modeler not a graph view of the actual database (which is the same)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I did not created index on my geometry …<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">(from database manager on qgis it look more like this):<u></u><u></u></span></p><p class="MsoNormal"><img width="619" height="799" style="width:6.4479in;height:8.3229in" id="m_-8773099637063814945Image_x0020_1" src="cid:image001.png@01D48D8B.FF940BD0"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> postgis-users <<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>> <b>De la part de</b> Darafei "Kom?pa" Praliaskouski<br><b>Envoyé :</b> jeudi 6 décembre 2018 17:43<br><b>À :</b> PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br><b>Objet :</b> Re: [postgis-users] Very long query time<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">did you create spatial index on your geometry?<u></u><u></u></p></div><div><p class="MsoNormal">your screenshot also does not show any geometry field.<u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Thu, Dec 6, 2018 at 7:29 PM Manchon Pierre <<a href="mailto:pierre.manchon@irstea.fr" target="_blank">pierre.manchon@irstea.fr</a>> wrote:<u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hello,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The indexes are code_zoneinteret and code_tuile on recouvrement</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><img border="0" width="420" height="463" style="width:4.375in;height:4.8229in" id="m_-8773099637063814945m_6987202526974796181Image_x0020_1"><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> postgis-users <<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>> <b>De la part de</b> Darafei "Kom?pa" Praliaskouski<br><b>Envoyé :</b> jeudi 6 décembre 2018 17:18<br><b>À :</b> PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br><b>Objet :</b> Re: [postgis-users] Very long query time</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Hello,<u></u><u></u></p><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">What are the indexes on the table?<u></u><u></u></p></div></div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal"><span lang="EN-US">On Thu, Dec 6, 2018 at 7:16 PM Manchon Pierre <</span><a href="mailto:pierre.manchon@irstea.fr" target="_blank"><span lang="EN-US">pierre.manchon@irstea.fr</span></a><span lang="EN-US">> wrote:</span><u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Yes the request took about ~100ms to be executed before but now it never ends (I left it 1h)</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">(thx for the tip with where clause)</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> postgis-users <</span><a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">postgis-users-bounces@lists.osgeo.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">> <b>De la part de</b> Tumasgiu Rossini<br><b>Envoyé :</b> jeudi 6 décembre 2018 17:09<br><b>À :</b> PostGIS Users Discussion <</span><a href="mailto:postgis-users@lists.osgeo.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">postgis-users@lists.osgeo.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br><b>Objet :</b> Re: [postgis-users] Very long query time</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal"><span lang="EN-US">I do not really understand.</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US">Is it a query which used to be faster ?</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US">A little remark on your where clause :</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US">it is unnecesseraly complicated and could be shortened to :</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US"> WHERE st_intersects(zi.geom, tile.geom)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US">True and false value doesn't need to be surronded by quote,</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US">here you are implicitly casting the string value 'true' to its boolean representation</span><u></u><u></u></p></div><div><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p></div></div><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p><div><div><p class="MsoNormal">Le jeu. 6 déc. 2018 à 16:53, Manchon Pierre <<a href="mailto:pierre.manchon@irstea.fr" target="_blank">pierre.manchon@irstea.fr</a>> a écrit :<u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span lang="EN-US">Hello there,</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">I'm new on the list and for a premiere I would like to know if some of you have a very long runtime for some of their queries (even with a LIMIT 5), whereas those queries were working well before (nothing changed from that). I'm using Postgre10, pgAdmin4 and postgis 2.4.4 on windows …</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">The infinite query I’m trying to execute: (only ~500 rows are stored on each of the two tables)</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p><table class="m_-8773099637063814945MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td width="626" valign="top" style="width:469.8pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt"><p class="MsoNormal"><span lang="EN-US">SELECT code_tile, code_zi FROM data.tile, data.zi</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">WHERE ST_Intersects(zi.geom, tile.geom) = 'true'</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">GROUP BY code_zi, code_tile, zi.geom, tile.geom</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">LIMIT 5</span><u></u><u></u></p></td></tr></table><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">Thank you for your time</span><u></u><u></u></p></div></div><p class="MsoNormal"><span lang="EN-US">_______________________________________________<br>postgis-users mailing list<br></span><a href="mailto:postgis-users@lists.osgeo.org" target="_blank"><span lang="EN-US">postgis-users@lists.osgeo.org</span></a><span lang="EN-US"><br></span><a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank"><span lang="EN-US">https://lists.osgeo.org/mailman/listinfo/postgis-users</span></a><u></u><u></u></p></blockquote></div></div></div><p class="MsoNormal"><span lang="EN-US">_______________________________________________<br>postgis-users mailing list<br></span><a href="mailto:postgis-users@lists.osgeo.org" target="_blank"><span lang="EN-US">postgis-users@lists.osgeo.org</span></a><span lang="EN-US"><br></span><a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank"><span lang="EN-US">https://lists.osgeo.org/mailman/listinfo/postgis-users</span></a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><span lang="EN-US"><br clear="all"></span><u></u><u></u></p><div><p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div><div><div><div><p class="MsoNormal">Darafei Praliaskouski<u></u><u></u></p></div><div><p class="MsoNormal">Support me: <a href="http://patreon.com/komzpa" target="_blank">http://patreon.com/komzpa</a><u></u><u></u></p></div></div></div></div></div></div><p class="MsoNormal">_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div><div><div><div><p class="MsoNormal">Darafei Praliaskouski<u></u><u></u></p></div><div><p class="MsoNormal">Support me: <a href="http://patreon.com/komzpa" target="_blank">http://patreon.com/komzpa</a><u></u><u></u></p></div></div></div></div></div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>