Hi,<br>Big performance issues are usually solved by setting the relationship inside the DBMS architecture. <br>IMHO we could give the user two options: <br>1- Creating a method in the vectordataprovider to build database-based relationships (as does ArcGIS, building relationship tables) and it wouldn&#39;t change the already existing code. The only difference would be that the user would load a view or a query, depending on the DBMS. QGIS already support some queries on it&#39;s data fetching.<br>
2- Creating on-the-fly relationships. These are a bit nasty as they eat up much memory and system performance. AND, I don&#39;t think it would be easy to implement as it would change how our vectordataprovider reads it&#39;s features. This relationship should be qgis-based as it must allow the user to relate data in different DBMS. I don&#39;t have a clear solution on how to implement this. Maybe changing the attribute methods inside vectordataprovider so that it also shows the other attributes.<br>
With the two options the user would be able to join data from the same DBMS with high performance and data with mixed DBMS with low, but easy, perfomance. <br>What do you guys think?<br>Mauricio de Paulo<br><br><br><div class="gmail_quote">
On Tue, Dec 1, 2009 at 2:15 PM, Marco Hugentobler <span dir="ltr">&lt;<a href="mailto:marco@hugis.net">marco@hugis.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All<br>
<br>
Isn&#39;t it much redesign work to make a model class out of QgsVectorLayer?<br>
<br>
Probably it would be enough to have a function in QgsVectorLayer that fetches<br>
features by attribute value. Then, at runtime, the layer that joins others,<br>
would call those functions and making the join transparent to users of<br>
QgsVectorLayer.<br>
<br>
For performance reasons, there should additionally be the possibility to<br>
create indices on vector layers for certain attributes. Such an index would<br>
not store the feature itself, only the relation between attribute value and<br>
feature id(s), ideally with the possibility to store large indices on disk.<br>
<br>
Just and idea...<br>
<br>
Regards,<br>
Marco<br>
<br>
<br>
<br>
<br>
<br>
<br>
Am Montag, 30. November 2009 22.11:47 schrieb Mailing Lists:<br>
<div><div></div><div class="h5">&gt; Hi Alex and others<br>
&gt;<br>
&gt; 8&lt;---------------snip-----------------------------<br>
&gt;<br>
&gt; &gt; I had contemplated this a little recently along similar lines. SQLite<br>
&gt; &gt; has a concept of IN-Memory databases. What if we created the procedure<br>
&gt; &gt; to put joins/relates (Any sql relationship) into an in memory DB, that<br>
&gt; &gt; way the procedure just needs to be re-run on project load. It would make<br>
&gt; &gt; accessing the &quot;joined&quot; tables fast and allow querying against them.<br>
&gt;<br>
&gt; As I commented on the ticket for table joins, I don&#39;t think this is<br>
&gt; the way to go. There are several reasons for this:<br>
&gt;<br>
&gt; - if the joined table is very large it wont all fit in memory and will<br>
&gt; ultimately cause a crash or a bogged down OS<br>
&gt; - dba&#39;s will hate us for hammering their databases with full table<br>
&gt; queries instead of paging<br>
&gt;<br>
&gt; I think that we should implement this using Qt&#39;s model view framework.<br>
&gt; It provides a way to abstract data access, provides pagination, and<br>
&gt; can be used in many contexts for &#39;free&#39; e.g. list and table views.<br>
&gt; Also if we use the built in database drivers for Qt they are easy to<br>
&gt; hook up to a model. And we can create custom models for esoteric<br>
&gt; datasources that are not directly supported.<br>
&gt;<br>
&gt; Our custom model can ad hoc fetch data from the related table as each<br>
&gt; page is requested so the need for loading heaps of stuff into memory<br>
&gt; can be avoided.<br>
&gt;<br>
&gt; Just my 5c<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
&gt; Tim<br>
&gt;<br>
&gt; &gt; The Arc model has some really good and some really annoying features,<br>
&gt; &gt; particularly poor handling of many to many and the lack of a full SQL<br>
&gt; &gt; operations as join operators.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Alex<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Qgis-developer mailing list<br>
&gt; &gt; <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
&gt;<br>
<br>
--<br>
</div></div>Dr. Marco Hugentobler<br>
HUGIS - GIS programming and consulting<br>
Webereistrasse 66<br>
CH-8134 Adliswil<br>
<a href="mailto:marco@hugis.net">marco@hugis.net</a><br>
<a href="http://homepage.hispeed.ch/hugis" target="_blank">http://homepage.hispeed.ch/hugis</a><br>
Technical Advisor QGIS Project Steering Committee<br>
<div><div></div><div class="h5">_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</div></div></blockquote></div><br>