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

fix: get reports api performance tuning #499

Merged
merged 12 commits into from
May 24, 2024

Conversation

goemen
Copy link
Contributor

@goemen goemen commented May 21, 2024

Description

The custom raw query returned lots of data that needed to be transformed and formatted to the required API response shape. This approach was causing performance issues. This fix uses SQL views to create a union of the pay_transparency_report and report_history and another view that creates a union of the calculated_data and calculated_data_history.

Prisma has a functionality to include SQL views in the schema, allowing us to join the two views making the queries faster.

Fixes # (issue)

https://finrms.atlassian.net/wiki/spaces/GEO/pages/143687718/Database+Design#Database-views

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

Further comments


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

Copy link

sonarcloud bot commented May 24, 2024

Quality Gate Passed Quality Gate passed for 'Pay Transparency backend-external'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 24, 2024

Quality Gate Passed Quality Gate passed for 'Pay Transparency Frontend'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 24, 2024

Quality Gate Passed Quality Gate passed for 'Pay Transparency doc-gen-service'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 24, 2024

Quality Gate Failed Quality Gate failed for 'Pay Transparency Backend'

Failed conditions
33.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@jer3k jer3k enabled auto-merge (squash) May 24, 2024 17:07
@jer3k jer3k disabled auto-merge May 24, 2024 17:16
@jer3k jer3k merged commit 12d658c into main May 24, 2024
28 of 29 checks passed
@jer3k jer3k deleted the fix/get-reports-api-performance-tuning branch May 24, 2024 17:16
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