SAFEHR-data / emap

Near real-time clinical database for research and innovation
2 stars 1 forks source link

hl7-reader very slow startup #63

Open jeremyestein opened 2 weeks ago

jeremyestein commented 2 weeks ago

The query in method getFirstMessageUnidFromDate is extremely slow (30+ minutes), probably due to persistdatetime in the IDS not having an index. This means that emap startup is limited by this step. This is particularly disruptive when running validation, which is often part of a development cycle.

We could request that an index be added, but perhaps also we can see whether the query can be improved?

If getting an index is going to be too difficult, assuming persistdatetime rank-correlates perfectly with unid (the PK), you could do a binary search in the client code to do the same query.