-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make first occurrence of event deterministic. Added order by _date, _id to criteria queries to use the event ID as the tiebreaker. Fixes #139. * Cohort Definition Query Optimization Optimized #primary_events and #qualified_events into single query, eliminating one temp table creation. Partitioning on person_id for event_ids allowing MPP architectures to leverage hashing on person_id. Fixes #141. * Added proper partitioning on person and event for gain counts. * Switched from qualified_events to included_events for end date selection.
- Loading branch information
1 parent
c7f9bb7
commit 5c0916d
Showing
17 changed files
with
42 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/resources/resources/cohortdefinition/sql/additionalCriteria.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
SELECT @indexId as index_id, p.event_id | ||
SELECT @indexId as index_id, p.person_id, p.event_id | ||
FROM @eventTable P | ||
LEFT JOIN | ||
( | ||
@criteriaQuery | ||
) A on A.person_id = P.person_id and @windowCriteria | ||
GROUP BY p.event_id | ||
GROUP BY p.person_id, p.event_id | ||
@occurrenceCriteria | ||
|
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/conditionEra.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/conditionOccurrence.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/deviceExposure.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/drugExposure.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/main/resources/resources/cohortdefinition/sql/groupQuery.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
select @indexId as index_id, event_id | ||
select @indexId as index_id, person_id, event_id | ||
FROM | ||
( | ||
select E.event_id | ||
select E.person_id, E.event_id | ||
FROM @eventTable E | ||
LEFT JOIN | ||
( | ||
@criteriaQueries | ||
) CQ on E.event_id = CQ.event_id | ||
GROUP BY E.event_id | ||
) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id | ||
GROUP BY E.person_id, E.event_id | ||
@intersectClause | ||
) G |
6 changes: 3 additions & 3 deletions
6
src/main/resources/resources/cohortdefinition/sql/inclusionrule.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/measurement.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/observation.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/procedureOccurrence.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/resources/cohortdefinition/sql/visitOccurrence.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters