Feature request #3451

Allow suppression of Postgis view key verification on every load

Added by Aren Cambre about 13 years ago. Updated about 13 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Project Loading/Saving
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:13511

Description

It appears that Postgres has no way of telling which column of a view is the key. Therefore, when QGIS loads a view, it tests candidate key columns until it finds one that satisfies this condition:


This is slow for large views, which are probably not uncommon in robust GIS applications. See http://forum.qgis.org/viewtopic.php?f=2&t=7014 for an example.

The cost is we have to choose a "letter of two evils": deal with slow loading or convert views into tables.

What if QGIS remembers the view's key in the project definition? Then the initial load penalty is only paid once in a project's life: the first time a view is loaded.

Associated revisions

Revision 35c53b3a
Added by Jürgen Fischer about 13 years ago

fix #3451: don't recheck saved primary key column for views when 'use estimates' is on

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15107 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 3cc6f3f9
Added by Jürgen Fischer about 13 years ago

fix #3451: don't recheck saved primary key column for views when 'use estimates' is on

git-svn-id: http://svn.osgeo.org/qgis/trunk@15107 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Aren Cambre about 13 years ago

BTW, I can see risk with this--if at point in time X, view's column A is a true key, but at point in time X+Y, column A has some duplicate values. Not sure how to deal with that except make the risks clear on the UI?

#2 Updated by Jürgen Fischer about 13 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

This was already addressed back in 468550c6 (SVN r10658). The key field is stored, but rechecked on load.

#3 Updated by Aren Cambre about 13 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

But it's still rechecked on every load. It's impossible for me to us a 12 million row view thanks to this.

#4 Updated by Jürgen Fischer about 13 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

fixed in 3cc6f3f9 (SVN r15108).

Also available in: Atom PDF