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

[OGR provider] Optimize feature requests with OrderBy clauses on a GeoPackage dataset #53266

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

rouault
Copy link
Contributor

@rouault rouault commented May 29, 2023

(fixes #53198)

OrderBy clauses are translated into a
"SELECT ... FROM ... [WHERE ...] ORDER BY ... [LIMIT x]" SQL statement
evaluated by GDAL

On a 3.2 million feature GeoPackage, this decreases the RAM consumption
from 6 GB to 0.5 GB, and is 50% faster. If a limit clause is added with
a small number, then the speed-up is massive.

Just move existing code from QgsOgrProviderUtils::setSubsetString() to
it
@rouault rouault mentioned this pull request May 29, 2023
2 tasks
…oPackage dataset

(fixes qgis#53198)

OrderBy clauses are translated into a
"SELECT ... FROM ... [WHERE ...] ORDER BY ... [LIMIT x]" SQL statement
evaluated by GDAL

On a 3.2 million feature GeoPackage, this decreases the RAM consumption
from 6 GB to 0.5 GB, and is 50% faster. If a limit clause is added with
a small number, then the speed-up is massive.
@rouault rouault force-pushed the ogr_provider_order_by_optim branch from f5cdc9d to b7632a1 Compare May 29, 2023 20:12
@github-actions github-actions bot added this to the 3.32.0 milestone May 29, 2023
@nyalldawson nyalldawson merged commit f720132 into qgis:master Jun 9, 2023
29 checks passed
@agiudiceandrea agiudiceandrea mentioned this pull request Nov 12, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Order by" memory leak
2 participants