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

Add MPI Indexes to Improve Performance #895

Merged
merged 21 commits into from
Oct 31, 2023
Merged

Add MPI Indexes to Improve Performance #895

merged 21 commits into from
Oct 31, 2023

Conversation

DanPaseltiner
Copy link
Collaborator

@DanPaseltiner DanPaseltiner commented Oct 31, 2023

PULL REQUEST

Summary

This PR introduces indexing on the MPI in order to optimize performance of the new flattened schema. After profiling we have found that two categories of index improve performance.

  1. Postgres does not automatically create indexes on foreign keys . Therefore introducing indexes on foreign key columns significantly improves performance of JOINS between tables.
  2. Indexing based on the specific filter criteria for each block improves performance of identifying the records that belong in each block. We compared simply indexing each column versus being more specific e.g. using the first or last 4 characters of a given column. The later offered the best performance.

Related Issue

Fixes #CDCgov/phdi-azure#296

Checklist

  • If this code affects the other scrum team, have they been notified? (In Slack, as reviewers, etc.)

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #895 (588e633) into main (cd7efb5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #895   +/-   ##
=======================================
  Coverage   96.38%   96.38%           
=======================================
  Files          48       48           
  Lines        2821     2821           
=======================================
  Hits         2719     2719           
  Misses        102      102           
Flag Coverage Δ
unit-tests 96.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Collaborator

@m-goggins m-goggins left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@DanPaseltiner DanPaseltiner merged commit fdf55d9 into main Oct 31, 2023
30 checks passed
@DanPaseltiner DanPaseltiner deleted the index-mpi branch October 31, 2023 14:44
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.

2 participants