instedd / surveda

InSTEDD Surveda
https://instedd.org/technologies/surveda-mobile-surveys/
GNU General Public License v3.0
17 stars 6 forks source link

Improve Interactions file generation startup time #2346

Closed matiasgarciaisaia closed 2 months ago

matiasgarciaisaia commented 4 months ago

Index survey_log_entries (which can grow really large) by channel_id to speed up a query checking for DISTINCT channel_id's when starting to generate the interactions file.

In a 10M-row table, the query goes down from 25s to less than 1s with the index.

matiasgarciaisaia commented 4 months ago

I still have to measure if/how this impacts performance while running the surveys themselves.

I wouldn't expect a lot of overhead, since there's usually just a single channel (maybe two, if doing multi-mode), but I haven't tested it yet.

anaPerezGhiglia commented 2 months ago

closing this PR in favor of #2359