[Qgis-developer] Table join branch

Martin Dobias wonder.sk at gmail.com
Mon Jul 19 12:27:49 EDT 2010


Hi Marco

On Mon, Jul 19, 2010 at 9:10 AM, Marco Hugentobler
<marco.hugentobler at sourcepole.ch> wrote:
>
> Internally, QgsVectorLayer stores the join info (fields and join table provider
> key) and remaps the field ids (first the provider ids, then the joined field ids
> and last the added field ids). When querying the joined field values, a subset
> string is set to the table provider to query a feature with the value of the
> join field.
>
> As you might expect, there are still a number of issues:
> - Joined fields cannot be edited (should they?). So attribute table and info-
> tool should disable those rows. QgsVectorLayer probably needs a method to tell
> attribute table and info tool which rows are not editable.
> - Performance is an issue. The current implementation tries to improve
> performance by automatically creating attribute indices in the ogr provider
> (could be implemented in other providers too). Still there is a siginificant
> performance penalty when doing classifications based on joined attributes or
> attributes searches (info tool and opening attribute table are usually fast,
> because not many features are queried at once).
> One possibility to enhance this could be to load tables into memory providers
> and implementing attribute index capability there. Are there other
> possibilities?

I will take a look on your implementation and post some comments.

I think it will be necessary to keep some kind of cache for the joins,
because even if there is an index on the joined field, accessing the
index (which is stored on disk) for each feature is costly.


> @Martin: in your gsoc blog, you write that you are refactoring the editing
> buffer to a utility class. Do you think the join info and the id remaping can
> be ported to the new design easily?

Well, there will be a good number of collisions as it does quite a lot
of changes in vector layers and data providers. I just hope my branch
will be the first to be merged into trunk :-D

Bye
Martin


More information about the Qgis-developer mailing list