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

improve puvspr.dat queries #397

Merged
merged 4 commits into from
Aug 5, 2021
Merged

Conversation

hotzevzl
Copy link
Member

@hotzevzl hotzevzl commented Aug 3, 2021

as discussed with Alicia - implementation based on view (which I have kept for the moment) does not allow (as far as I can think...) to prefilter by scenarioId - with the implementation proposed in this PR I have been able to get query times down from ~4min with test data to ~20secs (most of the deal is actually indexes, but still, we also filter out data we won't need)

@vercel
Copy link

vercel bot commented Aug 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

marxan – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan/DyksnAJzWiQ9nqEpFXPUDaWBLmu8
✅ Preview: https://marxan-git-chore-apiimprove-puvsprdat-queries-vizzuality1.vercel.app

marxan-storybook – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/CBXsULxxj6GpWghVPE4PiJVSS3bV
✅ Preview: https://marxan-storybook-git-chore-apiimprove-puvspr-9971ef-vizzuality1.vercel.app

@hotzevzl hotzevzl changed the base branch from develop to chore/api/MARXAN-547_mvp-link-plain-features-to-scenario August 3, 2021 13:50
@hotzevzl hotzevzl requested review from aagm and kgajowy August 3, 2021 13:50
@hotzevzl hotzevzl force-pushed the chore/api/MARXAN-547_mvp-link-plain-features-to-scenario branch from 779db1c to b482ed9 Compare August 3, 2021 16:07
@hotzevzl hotzevzl force-pushed the chore/api/improve-puvspr.dat-queries branch from d11064d to 492710b Compare August 3, 2021 16:09
@hotzevzl hotzevzl force-pushed the chore/api/improve-puvspr.dat-queries branch from 492710b to da9c477 Compare August 3, 2021 17:27
@hotzevzl hotzevzl force-pushed the chore/api/MARXAN-547_mvp-link-plain-features-to-scenario branch from c625998 to d82b287 Compare August 3, 2021 22:33
Copy link
Contributor

@kgajowy kgajowy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR seems to mix three different ones (deno bot, calculating protection status and improving puvspr dat). Would be great to clean it up first before jumping into review. Thanks!

@hotzevzl hotzevzl force-pushed the chore/api/improve-puvspr.dat-queries branch from da9c477 to 89458eb Compare August 4, 2021 13:40
@hotzevzl hotzevzl force-pushed the chore/api/MARXAN-547_mvp-link-plain-features-to-scenario branch from d82b287 to 13c0772 Compare August 4, 2021 18:02
@hotzevzl hotzevzl force-pushed the chore/api/improve-puvspr.dat-queries branch from 89458eb to 96fcc8c Compare August 4, 2021 18:09
Base automatically changed from chore/api/MARXAN-547_mvp-link-plain-features-to-scenario to develop August 4, 2021 18:18
Comment on lines +8 to +9
@InjectConnection(DbConnections.geoprocessingDB)
private readonly connection: Connection,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just use puvsprRepo.query instead creating new connection.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I know - I did so because with this PR the puvsprRepo should become redundant and we should be able to drop it altogether: I left it in the current PR in order not to change too much in case the new approach ends up not working out in practice, but all going well we should be able to drop the repo.

@hotzevzl
Copy link
Member Author

hotzevzl commented Aug 5, 2021

PR seems to mix three different ones (deno bot, calculating protection status and improving puvspr dat). Would be great to clean it up first before jumping into review. Thanks!

sorry about the PR stack mess - this is properly isolated now 😬

@hotzevzl hotzevzl merged commit 0043409 into develop Aug 5, 2021
@hotzevzl hotzevzl deleted the chore/api/improve-puvspr.dat-queries branch August 5, 2021 08:58
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.

3 participants