i2b2plugins / loyalty_cohort

Uses heuristics to find patients who get the majority of their care from your hospital system
Other
1 stars 3 forks source link

Performance issue with Step 1 - Visits #17

Open DarrenWHenderson opened 3 years ago

DarrenWHenderson commented 3 years ago

Attempted to solve a minor performance issue on larger datasets discovered by @jklann

I believe by moving the exists predicate to a join (subquery) tricks the optimizer into making a smarter plan. It cut runtime in half on my environment. Pull request to follow.