New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Trust project option #5094

Merged
merged 13 commits into from Sep 7, 2017

Conversation

Projects
None yet
4 participants
@pblottiere
Member

pblottiere commented Aug 30, 2017

Description

This PR adds the trustProject option.

When this option is activated:

  • extent for vector layers is directly read from the project file when the data provider has no metadata (for example in case of PostgreSQL views or materialized views)
  • primary key unicity is not checked in the PostgreSQL data provider

This option is convenient for the server in order to avoid spending to much time in getCapabilities when we know that the underlying data do not change.

Some tests has been added to confirm the behavior on PostgreSQL views and materialized views.

Checklist

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit
@haubourg

This comment has been minimized.

Show comment
Hide comment
@haubourg

haubourg Aug 30, 2017

Contributor

Note: this option will greatly speed up project loading either on Desktop or Server Context for big datasets accessed via views, materialized views or any data format not storing such metadata. Downsides are that if datasource has effectively changed, Project will need to be updated

Contributor

haubourg commented Aug 30, 2017

Note: this option will greatly speed up project loading either on Desktop or Server Context for big datasets accessed via views, materialized views or any data format not storing such metadata. Downsides are that if datasource has effectively changed, Project will need to be updated

@nyalldawson

This comment has been minimized.

Show comment
Hide comment
@nyalldawson

nyalldawson Aug 30, 2017

Contributor

Shouldn't this be set in the project properties rather than as a global option?

Contributor

nyalldawson commented Aug 30, 2017

Shouldn't this be set in the project properties rather than as a global option?

@pblottiere

This comment has been minimized.

Show comment
Hide comment
@pblottiere

pblottiere Aug 30, 2017

Member

Shouldn't this be set in the project properties rather than as a global option?

Good point... @haubourg do you agree?

Member

pblottiere commented Aug 30, 2017

Shouldn't this be set in the project properties rather than as a global option?

Good point... @haubourg do you agree?

@haubourg

This comment has been minimized.

Show comment
Hide comment
@haubourg

haubourg Aug 31, 2017

Contributor

+1 !

Contributor

haubourg commented Aug 31, 2017

+1 !

@pblottiere

This comment has been minimized.

Show comment
Hide comment
@pblottiere

pblottiere Sep 5, 2017

Member

I'll merge this PR tomorrow if I've no more comments in the meantime.

Member

pblottiere commented Sep 5, 2017

I'll merge this PR tomorrow if I've no more comments in the meantime.

@haubourg

This comment has been minimized.

Show comment
Hide comment
@haubourg

haubourg Sep 6, 2017

Contributor

In project properties, the option would may be better placed in the "Data Sources" tab.
BTW, renaming "Data Sources" to "Data sources" would be nice :)

Contributor

haubourg commented Sep 6, 2017

In project properties, the option would may be better placed in the "Data Sources" tab.
BTW, renaming "Data Sources" to "Data sources" would be nice :)

@haubourg

This comment has been minimized.

Show comment
Hide comment
@haubourg

haubourg Sep 6, 2017

Contributor

Beyond that, I couldn't find any problem in editing / updating extent workflow.
Editing from QGIS updates it automatically which is good. (Maybe with 1 trillion rows it would be nice to skip that too, let's see when his happens).
Changing data from the DB, QGIS with trust option will not change the extent unless pressing the "update extent button".
So +1 for me!

Contributor

haubourg commented Sep 6, 2017

Beyond that, I couldn't find any problem in editing / updating extent workflow.
Editing from QGIS updates it automatically which is good. (Maybe with 1 trillion rows it would be nice to skip that too, let's see when his happens).
Changing data from the DB, QGIS with trust option will not change the extent unless pressing the "update extent button".
So +1 for me!

@pblottiere

This comment has been minimized.

Show comment
Hide comment
@pblottiere

pblottiere Sep 7, 2017

Member

In project properties, the option would may be better placed in the "Data Sources" tab.

Done

Member

pblottiere commented Sep 7, 2017

In project properties, the option would may be better placed in the "Data Sources" tab.

Done

@pblottiere pblottiere merged commit 20d8244 into qgis:master Sep 7, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rldhont rldhont added the Server label Nov 6, 2017

@rldhont rldhont added this to the QGIS 3 milestone Nov 6, 2017

rldhont added a commit to rldhont/ms_perfs that referenced this pull request Jan 5, 2018

Test the Trust project option
In QGIS3, the user can add an option to force to trust the project about extent and primarykey in PostgreSQL/Postgis layers
qgis/QGIS#5094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment