OHDSI Home | Forums | Wiki | Github

Speed issue when using getDbCovariateData and other functions in FeatureExtraction and CohortMethod

Hi there!

I’m currently trying to implement an target-comparator analysis. I use an Microsoft SQL Omop Cdm database, with currently only 20 patients (in order to speed things up while implementing), but it still takes several minutes to perform each step, and the getDbCovariateData-function is behaving very weird at the moment.

After creating my cohorts, i run getDbCohortMethodData (currently taking 4 minutes), createStudyPopulation (very quick, < 1 sec), getDbCovariateData (10 hours!!!).

There must be something I’m doing wrong, when it takes several minutes for the function getDbCohortMethodData on a dataset with 20 patients. Moreover, getDbCovariateData is extreme. From the printouts I figured it was only the sql-execution that took so long:

And when I wanted to find out exactly how the function worked, it got even weirder. I copied in the code of getDbCovariateData from github into my script, and run a function call of that local copy, then it “only” took 11 minutes. After some digging I managed to extract the sql query that was executed, and I run that query locally from Microsoft SQL Management Studio, then it took 30 seconds.

I really don’t know what to do next. Have anyone experienced similar issues (general speed issues, or really weird speed issues like for me with getDbCovariateData), and if so, how did you solve it?