Bug report #17502

QGIS eats too much data with relation reference widget

Added by Regis Haubourg about 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:High
Assignee:Hugo Mercier
Category:Edit widget
Affected QGIS version:2.18.14 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25399

Description

When using large databases in QGIS 2.18.14, I discovered QGIS was fetching 3 times the referenced table objects.

How to reproduce:

- create a DB with two tables, on reference table and one referencing with a FK pointing to the reference table.

- configure the relation in QGIS and add a relation reference widget on the FK field

(use only one readonly line and point on map tool activated)

- create a referencing object > its fast

- reopen the object form > it's slow and querying three times the reference dataset, including all fields when only id, geom and tooltip fields should be necessary.

Anyway, for QGIS 3 fixing that will not solve totally the real issue that is that loading all the reference layer is overkill. asynchroneous loading is being made by Matthias in QGIS 3, but only loading in the current extent, and only fetching the required fields (id, geom, PK, display expression result) would be very nice.

PG_LOG (61.2 KB) Regis Haubourg, 2017-11-20 02:57 PM

Associated revisions

Revision 5fb970ab
Added by Hugo Mercier about 7 years ago

Postgresql: don't fetch if there is nothing (fixes #17502)

Revision dbd4f9ef
Added by Hugo Mercier about 7 years ago

Merge pull request #5677 from mhugo/fix_slow_relation_reference

Postgresql: don't fetch if there is nothing (fixes #17502)

History

#1 Updated by Hugo Mercier about 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF