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

Added dynamic views (instead of the stored views) #491

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

antoineludeau
Copy link
Member

Context

The transfer process from postgresql to mongodb is using stored views in postgresql to calculate some extra data such as postal code data and geo data (bounding boxes, centroid, ...). Currently, this process can be quite long.

Enhancement

In order to improve the performances of the transfer process, this PR :

  • delete the stored view (some calculs were done on all the addresses and common toponyms of the database instead of targeting only a specific district),
  • add dynamic views to target only one district,
  • add rights for ban-plateforme user to use the "external" schema tables.
  • modify the structure of the views to improve performances (delete subqueries in CASE statements that lower the perf + add Common Table Expressions (CTEs) to improve readability).

@antoineludeau antoineludeau marked this pull request as ready for review November 25, 2024 13:02
@antoineludeau antoineludeau self-assigned this Nov 26, 2024
@antoineludeau antoineludeau linked an issue Nov 26, 2024 that may be closed by this pull request
@antoineludeau antoineludeau merged commit e885222 into master Dec 10, 2024
1 check passed
@antoineludeau antoineludeau deleted the antoineludeau/improve_view_performance branch December 10, 2024 16:15
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.

[Ban-Plateforme] : Amélioration perf calculs géo
2 participants