<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 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EstiloCorreo19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
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=ES link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi, Andreas, thanks for your help.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>We tried the built-in relation support, combined with the edit widgets and form view. Is that what you mean? Powerful features as they are, they don’t fit our needs, however. There are quite a few tables, with two-level relationships; the generated forms and the workflow using the built-in solution is still too complex for our digitizers daily work. We also had doubts regarding to how to handle referential integrity constraints in edit mode. That’s why we finally decided to build our own plugin.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>In any case, I have taken a look at it again; it feels somewhat slower than our solution when not editing, and roughly the same in edit mode (no measures, though, just my first subjective impressions).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Neumann, Andreas [mailto:a.neumann@carto.net] <br><b>Enviado el:</b> viernes, 08 de abril de 2016 16:02<br><b>Para:</b> Manuel Hernández Martínez<br><b>CC:</b> 'qgis-developer@lists.osgeo.org'<br><b>Asunto:</b> Re: [Qgis-developer] PostGIS queries slow when in edit mode<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Hi Manuel,<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>QGIS already has built-in relation support (1:n and n:m) - they should support server side queries. Do you really need to write your own plugin? Are the built-in relations not good enough?<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Andreas<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>On 2016-04-08 15:26, Manuel Hernández Martínez wrote:<o:p></o:p></span></p><blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm'><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi!<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I'm developing a plugin for QGIS. When the user selects a feature, it queries a few other layers from Postgis to fill in a form with related data.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The queries are slow, unless I check the option to run queries server-side. After that, the queries run instantaneously. Yay!<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>However, if the layers are put in edit mode, the queries are slow again! :(<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>After checking the Postgis logs it seems that the run queries server-side option has no effect when the layers are in edit mode.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Does anyone know whether it is a known, well-founded limitation or a bug?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regards, Manuel<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><hr size=2 width="100%" align=center></span></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><strong><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#333333'>Manuel Hernández Martínez</span></strong><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#333333'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><span style='font-size:9.0pt'><a href="mailto:mhernandezm@agenciamedioambienteyagua.es">mhernandezm@agenciamedioambienteyagua.es</a> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><span style='font-size:9.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><span style='font-size:9.0pt;font-family:"Arial","sans-serif"'>Agencia de Medio Ambiente y Agua de Andalucía. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><a href="http://www.agenciamedioambienteyagua.es/" title="http://www.egmasa.es/"><span style='font-size:9.0pt'>http://www.agenciamedioambienteyagua.es</span></a><span style='font-size:9.0pt;color:blue'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><span style='font-size:9.0pt;font-family:"Arial","sans-serif"'>Subdirección de Tecnologías de la Información<span style='color:#333333'>.</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#333333'>Red de Información Ambiental de Andalucía, REDIAM. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify'><span style='font-size:9.0pt;color:#333333'> </span><o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=631 style='width:473.2pt;border-collapse:collapse'><tr style='height:11.25pt'><td width=631 colspan=2 valign=bottom style='width:473.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:11.25pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;line-height:11.25pt'><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:black'>Johan G. Gutenberg, 1. Isla de la Cartuja</span><o:p></o:p></p></td></tr><tr style='height:11.25pt'><td width=631 colspan=2 valign=bottom style='width:473.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:11.25pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;line-height:11.25pt'><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:black'>41092 - SEVILLA, Sevilla. (Spain)</span><o:p></o:p></p></td></tr><tr style='height:11.25pt'><td width=631 colspan=2 valign=bottom style='width:473.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:11.25pt'><p class=MsoNormal style='mso-line-height-alt:11.25pt'> <o:p></o:p></p></td></tr><tr style='height:10.15pt'><td width=37 valign=bottom style='width:27.65pt;padding:0cm 5.4pt 0cm 5.4pt;height:10.15pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;line-height:10.15pt'><span style='font-size:9.0pt;color:black'>Tel: </span><o:p></o:p></p></td><td width=594 valign=bottom style='width:445.55pt;padding:0cm 0cm 0cm 0cm;height:10.15pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;line-height:10.15pt'><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:black'>+34 955 26 00 00 / +34 902 52 51 00</span><o:p></o:p></p></td></tr><tr style='height:10.15pt'><td width=37 valign=bottom style='width:27.65pt;padding:0cm 5.4pt 0cm 5.4pt;height:10.15pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;line-height:10.15pt'><span style='font-size:9.0pt;color:black'>Fax: </span><o:p></o:p></p></td><td width=594 valign=bottom style='width:445.55pt;padding:0cm 0cm 0cm 0cm;height:10.15pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;line-height:10.15pt'><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:black'>+34 955 04 46 10</span><o:p></o:p></p></td></tr><tr style='height:5.65pt'><td width=37 valign=bottom style='width:27.65pt;padding:0cm 5.4pt 0cm 5.4pt;height:5.65pt'><p class=MsoNormal style='mso-line-height-alt:5.65pt'> <o:p></o:p></p></td><td width=594 valign=top style='width:445.55pt;padding:0cm 0cm 0cm 0cm;height:5.65pt'><p class=MsoNormal style='mso-line-height-alt:5.65pt'> <o:p></o:p></p></td></tr><tr style='height:3.5pt'><td width=631 colspan=2 valign=bottom style='width:473.2pt;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:3.5pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;mso-line-height-alt:3.5pt'><strong><span style='font-size:9.0pt;color:#006600'>En la medida de lo posible, evite imprimir este correo. </span></strong><o:p></o:p></p></td></tr><tr style='height:3.5pt'><td width=631 colspan=2 valign=top style='width:473.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:3.5pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;mso-line-height-alt:3.5pt'><span style='font-size:9.0pt;color:black'>Este correo electrónico y los documentos que en él se puedan adjuntar, contiene información de carácter confidencial dirigida exclusivamente a su/s destinatario/s. Si Usted no es el destinatario de este mensaje, le ruego que lo destruya sin hacer copia digital o física, comunicando por correo electrónico, fax o teléfono a la Agencia de Medio Ambiente y Agua de Andalucía la recepción del mismo. Así mismo, queda expresamente prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de la Agencia de Medio Ambiente y Agua de Andalucía. </span><o:p></o:p></p></td></tr></table><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>_______________________________________________<br>Qgis-developer mailing list<br><a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></span></p></div></blockquote><p><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p></div></div></body></html>