dssg / matching-tool

Integrating HMIS and criminal-justice data
Other
7 stars 7 forks source link

Introduce proper indexes on tables queried by webapp #354

Open thcrock opened 6 years ago

thcrock commented 6 years ago

Some of the larger datasets can be tough to query from the webapp. Besides the primary key index, it likely needs indexes on all the relevant dates (e.g. client start/end) and ids (matched id, event it)

thcrock commented 6 years ago

Also the query seems to do better flipping the temporal filter from the intersection of two 'NOT' clauses to the union of two regular clauses. A tsrange is possible but poses some more problems with irregular data.

thcrock commented 6 years ago

Further work made improvements brittle. Things that worked for some cases made other cases worse. It's not an insurmountable problem, but work on that will have to wait.