[Qgis-developer] table join

Marco Hugentobler marco at hugis.net
Tue Dec 1 11:15:12 EST 2009


Hi All

Isn't it much redesign work to make a model class out of QgsVectorLayer?

Probably it would be enough to have a function in QgsVectorLayer that fetches 
features by attribute value. Then, at runtime, the layer that joins others, 
would call those functions and making the join transparent to users of 
QgsVectorLayer.

For performance reasons, there should additionally be the possibility to 
create indices on vector layers for certain attributes. Such an index would 
not store the feature itself, only the relation between attribute value and 
feature id(s), ideally with the possibility to store large indices on disk.

Just and idea...

Regards,
Marco

 




Am Montag, 30. November 2009 22.11:47 schrieb Mailing Lists:
> Hi Alex and others
> 
> 8<---------------snip-----------------------------
> 
> > I had contemplated this a little recently along similar lines. SQLite
> > has a concept of IN-Memory databases. What if we created the procedure
> > to put joins/relates (Any sql relationship) into an in memory DB, that
> > way the procedure just needs to be re-run on project load. It would make
> > accessing the "joined" tables fast and allow querying against them.
> 
> As I commented on the ticket for table joins, I don't think this is
> the way to go. There are several reasons for this:
> 
> - if the joined table is very large it wont all fit in memory and will
> ultimately cause a crash or a bogged down OS
> - dba's will hate us for hammering their databases with full table
> queries instead of paging
> 
> I think that we should implement this using Qt's model view framework.
> It provides a way to abstract data access, provides pagination, and
> can be used in many contexts for 'free' e.g. list and table views.
> Also if we use the built in database drivers for Qt they are easy to
> hook up to a model. And we can create custom models for esoteric
> datasources that are not directly supported.
> 
> Our custom model can ad hoc fetch data from the related table as each
> page is requested so the need for loading heaps of stuff into memory
> can be avoided.
> 
> Just my 5c
> 
> Regards
> 
> Tim
> 
> > The Arc model has some really good and some really annoying features,
> > particularly poor handling of many to many and the lack of a full SQL
> > operations as join operators.
> >
> >
> >
> >
> >
> > Alex
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 

-- 
Dr. Marco Hugentobler
HUGIS - GIS programming and consulting
Webereistrasse 66
CH-8134 Adliswil
marco at hugis.net
http://homepage.hispeed.ch/hugis
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list