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

temporal: use UPDATE-FROM syntax for updating metadata tables #3359

Merged
merged 9 commits into from
Feb 3, 2024

Conversation

ninsbl
Copy link
Member

@ninsbl ninsbl commented Jan 13, 2024

SQLITE versions >= 3.30 support the UPDATE-FROM syntax. So SQL syntax in SQLITE became equal to PostgreSQL.
That means multiple columns in temporal metadata tables can now be updated from one subquery. That improves performace esp. for larger tables and simplifies the code.

Performance improvements in #3350 are more significant, though. Together with #3350 this adresses: #3136

On that occasion also the TGIS v3 related extra query for semantic labels is integrated into the main query and now gets commented out for older databases instead of running an additional query for newer databases...

Since this PR sets the minimal SQLite version to 3.30 (gets shipped e.g. with Ubuntu 20.04) I would suggest not to backport this PR...

@ninsbl ninsbl added enhancement New feature or request temporal Related to temporal data processing Python Related code is in Python database Related to database management libraries labels Jan 13, 2024
@ninsbl ninsbl added this to the 8.4.0 milestone Jan 13, 2024
@github-actions github-actions bot added docs and removed database Related to database management labels Jan 13, 2024
@github-actions github-actions bot removed the docs label Jan 14, 2024
@ninsbl
Copy link
Member Author

ninsbl commented Feb 3, 2024

Is it OK, to merge this as is, since it improves the performance noticeably?
The queries may be tuned more if needed, in another PR?

@echoix
Copy link
Member

echoix commented Feb 3, 2024

Oh, it wasn't merged yet! Of course it could be a good thing!

@ninsbl
Copy link
Member Author

ninsbl commented Feb 3, 2024

Oh, it wasn't merged yet! Of course it could be a good thing!

Can you approve the PR?

@echoix
Copy link
Member

echoix commented Feb 3, 2024

Sorry!

@ninsbl ninsbl merged commit 89cf288 into OSGeo:main Feb 3, 2024
25 checks passed
jadenabrams100 pushed a commit to ncsu-csc472-spring2024/grass-CI-playground that referenced this pull request Feb 21, 2024
…3359)

* use UPDATE-FROM syntax

* update version_handling

* integrated in main SQL update

* remove table name from set and use JOIN

* add FROM

* NATURAL JOIN

* use JOIN-ON

* fix SQL syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libraries Python Related code is in Python temporal Related to temporal data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants