<div dir="ltr"><div>Hi,</div><div><br></div><div>I am trying to create a virtual layer that involves an attributes join between two layers. <br></div><div>something like this:</div><div><br></div><div>SELECT <br>  l.seg_via_rodov_id,<br>  l.via_rodov_id,<br>  vr.nome<br>FROM lig_segviarodov_viarodov as l,<br>  "Via rodoviária" as vr<br>where vr.identificador = l.via_rodov_id;<br><br></div><div>These two layer are saved in postgreSQL \ PostGIS and have and there's actually a foreign key constraint on .via_rodov_id referencing the vr.identificador.</div><div><br></div><div>As a virtual layer, this is painfully slow. Slow to the point of waiting 1 or 2 minutes to get the answer, while the same query on postgresql takes less than one second.</div><div><br></div><div>Not sure if this is expected or not or if it's a bug.<br></div><div><br></div><div>The reason I want to make this query as a virtual layer, instead of loading it as a postgresql query directly, is because I want to use this relation information in labels, and I wanted those labels to get updated before I save the data in the database (to help the editor to understand if a certain object is already updated or not)<br></div><div><br></div><div>I wonder if there's some workaround to help me with this.</div><div><br></div><div>Thanks</div><div><br></div><div>Alexandre Neto<br></div></div>