qgis/QGIS — pull request #1544 by mhugent (2014-08-18 16:18:20+00:00)
Title: [FEATURE]: Joins in QgsExpression

This pull request adds joins in expressions. Using JOIN 'tablename' ON 'attributeX = "tablename.attributeY"', all the attributes of the join tables can be used in an expression. To improve performance (expressions are copied often), QgsExpression holds a join cache. If a joined table is too large (more than 10 million entries), there is a fallback to on-the-fly retrieval (with very low performance).

Some things to note:
- The join must be an equi-join and is provided as a string. It is not an expression to make it clear to people they cannot use more complex join conditions, like 'sqrt(attribute1) > ( table.attribute2 + table.attribute2)'.
- It is possible to join multiple tables by adding multiple JOIN-statements. But the joins cannot depend on each other (this limitation is the same as with the normal qgis vector layer join).
- The functions addJoinedAttributesFromCache() and addJoinedAttributesDirect() should probably unified with the join buffer code in future