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
[postgres] Fix superslow layer instantiation in huge databases by only fetching type info of used fields. #38158
Merged
borysiasty
merged 4 commits into
qgis:master
from
borysiasty:fix_38114_superslow_postgres_provider
Aug 6, 2020
Merged
[postgres] Fix superslow layer instantiation in huge databases by only fetching type info of used fields. #38158
borysiasty
merged 4 commits into
qgis:master
from
borysiasty:fix_38114_superslow_postgres_provider
Aug 6, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
borysiasty
added
Data Provider
Related to specific vector, raster or mesh data providers
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
labels
Aug 5, 2020
borysiasty
changed the title
[postgres] Fix superslow layer instantiation with huge databases by only fetching type info of used fields.
[postgres] Fix superslow layer instantiation in huge databases by only fetching type info of used fields.
Aug 5, 2020
nyalldawson
reviewed
Aug 5, 2020
nyalldawson
approved these changes
Aug 5, 2020
Looks great, thanks! |
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
m-kuhn
approved these changes
Aug 6, 2020
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
The failed Azure build doesn't look related. |
This was referenced Aug 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Data Provider
Related to specific vector, raster or mesh data providers
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a postgresql database contains hundreds of thousands tables, instantiating any layer becomes madly slow, because QgsPostgresProvider::loadFields fetches type info for all those tables, instead of just columns of source table(s). See bug #38114.
This PR adds a filter to only fetch used columns, speeding up project opening in my case from over one hour (!) to a couple of seconds.
Supersedes #38115.