Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CREATE TABLE diagnosishypertension_first SELECT STUDY_ID, DIAGNOSIS_DATE AS DIAGNOSIS_DATE_FIRST, ENCOUNTER_ID FROM diagnosishypertension a WHERE DIAGNOSIS_DATE = (SELECT MIN(DIAGNOSIS_DATE) FROM diagnosishypertension b WHERE b.STUDY_ID=a.STUDY_ID)


The solution is to read into MATLAB. However, we run out of java heap memory, so we need to 1) increase the meomery, and 2) set the db preferences to read in batches. 

Image Added

Image Added

Now we get a pretty good reduction - 48+hours to 1 minute!

Image Added