Skip to content

Conversation

@azizbekxm
Copy link
Contributor

@azizbekxm azizbekxm commented Mar 12, 2024

Purpose

https://folio-org.atlassian.net/browse/MODINVOSTO-177

Approach

Used same refactoring with #171 pr except for sql script
In this pr sql script approach used

Leearning

By using Hash join instead of inner loop increased query performance by 99%

First SQL Script execution time ~8min

telegram-cloud-photo-size-2-5443099096484271155-y
telegram-cloud-photo-size-2-5443099096484271156-y

Second SQL script executino time ~3sec

telegram-cloud-photo-size-2-5443099096484271163-y
telegram-cloud-photo-size-2-5443099096484271161-y

reference to further learning
https://dev.to/mahmoudhossam917/nested-join-vs-hash-join-vs-merge-join-in-postgresql-1ha6#:~:text=Nested%20Loop%20Join%20is%20suitable,best%20for%20joining%20sorted%20tables.
https://www.youtube.com/watch?v=pJWCwfv983Q&t=2s

Azizbek Khushvakov and others added 24 commits February 29, 2024 14:01
@azizbekxm azizbekxm changed the title [MODINVISTO - 177] - Wrote sql approach for fiscal year is not populated on invoices created prior to Poppy [MODINVISTO - 177] - Created SQL script for migration Mar 12, 2024
@azizbekxm azizbekxm marked this pull request as ready for review March 12, 2024 13:51
SELECT inv.id AS invoice_id,
to_jsonb(trx.jsonb->>'fiscalYearId') AS fiscal_year_id
FROM ${myuniversity}_${mymodule}.invoices AS inv
JOIN ${myuniversity}_mod_finance_storage.transaction AS trx
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SQL script making unit tests failing
image

@azizbekxm azizbekxm requested a review from a team March 13, 2024 08:21
@azizbekxm azizbekxm marked this pull request as draft March 13, 2024 13:13
@azizbekxm azizbekxm changed the title [MODINVISTO - 177] - Created SQL script for migration [MODINVISTO - 177] - Refactoring: Removing deprecated methods and replaced CompatibleFuture to Future and improvements Mar 15, 2024
@sonarqubecloud
Copy link

@azizbekxm azizbekxm removed the request for review from a team March 15, 2024 06:13
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 1, 2024

@sonarqubecloud
Copy link

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ SerhiiNosko
❌ Azizbek Khushvakov


Azizbek Khushvakov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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