-
-
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
Fix mixed layer oracle, fix #32521 #34358
Fix mixed layer oracle, fix #32521 #34358
Conversation
… the same table, fix addFeatures function to cast simple geom to multi geom when the loaded layer has multi geom type
20032b4
to
f984b27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a problem because there is only one detected geometry when it could have several (multipolygon and polygon for instance)
EDIT: forget about this one, I miss the second qry.next and so the detectedType will be Unknown, so it works
What about a use case where we do not care if it is a polygon or a multi-polygon? This PR would break it? |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Conflict to resolve |
case QgsWkbTypes::LineString: | ||
case QgsWkbTypes::LineString25D: | ||
case QgsWkbTypes::LineStringZ: | ||
// LineString gtype ends with 2, sdo_interpretation must not be equal to 2 (CircularString) or 3 (Nurbs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this filter will decrease performances, because it requests all interpretation from the table and then join on PK. It is worth trying on big dataset but I'm pretty sure this one should be better
SELECT "pk" FROM QGIS.LINE_DATA l
WHERE mod(l."GEOM"."SDO_GTYPE",100) = 2
AND (
SELECT MAX(DECODE(MOD(ROWNUM, 3), 0, t.COLUMN_VALUE, NULL))
FROM TABLE(l."GEOM"."SDO_ELEM_INFO") t
) not in (2,3);
We should also put this request in a QString and reuse it in all following filters with just parameter for sdo_gtype and in/not in 2,3/4
@SebastienPeillet Modifications looks fine to me. Did you manage to make some test on big dataset to check if there is no performance issues |
@troopa81 I tried this morning with a table that has 162k features. Without our modification : 162k features (simple and multi polygon) loaded in ~32s With our modification : 108k features (simple polygon) loaded in ~35s |
I did some test in Oracle to avoid QGIS interferences. There is two requests that are been changed. I limited result to 100k lines to get First request :
and with changes :
Second requestThe second request is more difficult to evaluate due to print output. On one hand I measure the request with the print, on the other I remove the print by setting With output print :The original request :
with changes :
for both, execution time is between 3.75s and 4.22s, depends on print surely. Without print but with explainFor original request the execution time is between 0.78s and 1.02s For modified request the execution time is between 1.42s and 1.56s |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Closing manually because stale-bot seems to have gone on holiday |
Description
Fix #32521
When Qgis loads Oracle database, it lists a row per geometry type in a table (yes, by design it think it could'nt be authorized to have several geometry types in a table... but it's oracle).
In the issue example, for the same table, there is two entries. One for polygon and one for multipolygon. But when user loads the polygon layer, all polygon geometries (included multipolygon) are loaded and the reverse is also true for the multipolygon layer.
I fixed it by filtering simple and multi geometries in the oracle connection. Doing this, i had to fix some functions in the provider :
EDIT : after seeing troubles by only filter single and multi geometry, I also filtered geometry types that were loaded together before (like LineString and CircularString), see my message below
I added testFilterSimpleMultiGeom test, but I also had to fix some tests in consequence.
Could be backported to 3.10.
CheckList
Commit messages are descriptive and explain the rationale for changes.
Commits which fix bugs include
Fixes #11111
at the bottom of the commit message. If this is your first pull request and you forgot to do this, write the same statement into this text field with the pull request description.New unit tests have been added for relevant changes
You have run the
scripts/prepare-commit.sh
script (https://github.com/qgis/QGIS/blob/master/.github/CONTRIBUTING.md#contributing-to-qgis) before each commit.If you didn't do this, you can also run
./scripts/astyle-all.sh
from your source folder.You have read the QGIS Coding Standards (https://docs.qgis.org/testing/en/docs/developers_guide/codingstandards.html) and this PR complies with them