-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Postgis add layer dialog: Cancel slow operations #15541
Comments
Author Name: Jürgen Fischer (@jef-n)
If your geometry type and srids are not fully - either because it's not in @geometry_columns@ or not listed with a point, line or polygon type in @geometry_columns@, QGIS needs to find which geometry types and srids are available.
If you close the detection thread is notified to not run any more queries - but as the queries are blocking (that's why there is a thread) the thread can only react on that once the running query finishes.
Not sure. That might into race conditions. |
Author Name: Matthias Kuhn (@m-kuhn) ??If your geometry type and srids are not fully - either because it's not in geometry_columns or not listed with a point, line or polygon type in geometry_columns, QGIS needs to find which geometry types and srids are available.?? So maybe in addition to this bug there should be a feature request, to Concerning the cancellation of a request. I've looked at the PG docs and found the method PQcancel. I've never worked with this lib but this method looks promising to me and should be thread-safe. I think there is no reason to let the query complete, as the result will be discarded anyway? |
Author Name: Jürgen Fischer (@jef-n) Matthias Kuhn wrote:
That only helps if you have multiple schemas and even then a single schema might be enough to show the same behaviour.
You can already setup your connection that way - and use check "use estimated metadata", which should help a lot, if you're dealing with large databases.
In PostGIS 2.0 @geometry_columns@ isn't a table anymore anyway.
Good point. I'll take a look at that. |
Author Name: Matthias Kuhn (@m-kuhn) Jürgen Fischer wrote:
True. It's probably the wrong approach.
Yes, I've just been told about this possibility. It's just not too intuitive. I wouldn't know if I didn't have somebody to tell me. I still think it would be a good idea to print some information next to the affected tables/views and tell the user, what the problem is, and what can be done about it. A yellow warning triangle and a popup with a short explanation would be good.
So this problem is solved there by design? I wonder how many people are still using PG 1.x and when everybody will have updated?
Great |
Author Name: Matthias Kuhn (@m-kuhn) Perfect. Works like a charm. I'll mark this closed as the issue in the title is fixed.
|
Author Name: hamish - (hamish -) Hi, just as a point of info for anyone in the same situation as me: I had to change the geometry_columns type to MULTILINESTRING instead of LINE, otherwise it just got stuck on "Detecting..." forever (or at least >10 minutes, when I canceled it). POINTS was fine as POINTS, I haven't needed to try POLYGON vs. MULTIPOLYGON but perhaps there are similar issues there. Thanks for the tip, connecting to the PostGIS db (and/or going into the Query Builder) now takes 2 seconds instead of 4 minutes for these large datasets, even without turning on the 'estimate table metadata' tick box in the server settings (glad to know about that trick too). regards, |
Author Name: Matthias Kuhn (@m-kuhn)
Original Redmine Issue: 6232
Affected QGIS version: master
Redmine category:data_provider/postgis
When I click on "Add postgis layer" and select a database and click "Connect", all the schemes appear pretty fast and I can select a table (in ~2s). To fully "load" the database (i.e. when the text of the button "Stop" changes to "Connect" and the button "Add" is enabled) it takes much longer (>20s). I don't know, what information is loaded in the additional time.
There are a number of problems with this associated here:
Problems:
Questions:
The text was updated successfully, but these errors were encountered: