[Qgis-developer] table join

Mailing Lists lists at linfiniti.com
Tue Dec 1 14:23:54 EST 2009


Hi Marco



On Tue, Dec 1, 2009 at 6:15 PM, Marco Hugentobler <marco at hugis.net> wrote:
> Hi All
>
> Isn't it much redesign work to make a model class out of QgsVectorLayer?

Although I havent looked at the code too much, I recall Martins table
updates wrapped providers in a model. I was thinking we could use the
same approach and then select the joined records dynamically as each
model page is accessed....it was just a thought anyway....


Regards

Tim

>
> 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
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list