Skip to content
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

PG: faster information retrieval for table info #56090

Merged

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Jan 30, 2024

Information about single tables does not need to
scan for all tables anymore.

Fix #56069

Information about single tables does not need to
scan for all tables anymore.

Fix qgis#56069
@elpaso elpaso added Optimization I feel the need... the need for speed! PostGIS data provider labels Jan 30, 2024
@github-actions github-actions bot added this to the 3.36.0 milestone Jan 30, 2024
Copy link

github-actions bot commented Jan 30, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 46a5ddd)

@strk
Copy link
Contributor

strk commented Jan 30, 2024

I appreciate the goal of this PR but adding another parameter to the existing overcomplex function doesn't seem the best approach here. Had you considered creating a new simplified function to fetch info about a single table ? Parameters like "searchGeometryColumnsOnly" or "searchPublicOnly" do not make any sense with a function that's asked for a specific table

Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've bumped into this as well when accessing slow remote databases!

src/providers/postgres/qgspostgresproviderconnection.cpp Outdated Show resolved Hide resolved
@elpaso elpaso merged commit 0c8b576 into qgis:master Feb 5, 2024
29 checks passed
@elpaso elpaso deleted the bugfix-gh56069-postgis-reduce-tables-query branch February 5, 2024 08:32
@kannes
Copy link
Contributor

kannes commented Feb 7, 2024

Thank you so much, @elpaso and @rouault . This will safe lots of unnecessarily burned resources :)

@kannes
Copy link
Contributor

kannes commented Feb 8, 2024

Any chance to get this backported into 3.34 (so it lands in LTR soonish) in exchange for some German Marzipan if I make to Slovakia in September? 😊

@qgis-bot
Copy link
Collaborator

The backport to release-3_34 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 1ed4113ef1c... PG: faster information retrieval for table info
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

stdout
Auto-merging src/providers/postgres/qgspostgresconn.cpp
CONFLICT (content): Merge conflict in src/providers/postgres/qgspostgresconn.cpp
Auto-merging src/providers/postgres/qgspostgresproviderconnection.cpp
CONFLICT (content): Merge conflict in src/providers/postgres/qgspostgresproviderconnection.cpp

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_34 release-3_34
# Navigate to the new working tree
cd .worktrees/backport-release-3_34
# Create a new branch
git switch --create backport-56090-to-release-3_34
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 1ed4113ef1c60ef612e4855c091b80f52ece5c4b,f182d76615f521c514d0a507b8891fe382d780c5,c4898c1fede5a113f52a86de247f2bc77e120484,46a5ddd25164408fe35e0bc5340663d2f813864d
# Push it to GitHub
git push --set-upstream origin backport-56090-to-release-3_34
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_34

Then, create a pull request where the base branch is release-3_34 and the compare/head branch is backport-56090-to-release-3_34.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_34 failed backport The automated backport attempt failed, needs a manual backport Optimization I feel the need... the need for speed! PostGIS data provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expanding PostGIS table/schema in browser panel triggers slow inspection of all tables in schema
6 participants