Fix/upsert performance (#163)
Fix/upsert performance (#163)

* problem: upsert performance is slow

lazy load columns (tag and messages) since they are not used
dont't run the search query twice
add an index on the tag column

* problem: missing lazyload import

* problem: joining tags table is slow

at least in sqlite selecting an indicator by indicator+provider is crazy
fast(2ms) but once you join the tags table it is crazy slow (140ms)

* problem: stupid typo

* problem: eagerloading tags is slightly slow

lazyloading all fields means it will run one query per indicator, but
there looks like there only ever is one, so the simpler query it ends up
running is more efficient.

* problem: tag index not required after all

changing indicator upsert code made these lookups all based on primary key

It's possibly that other queries in cif may benfit from this, so it may
come back at some point.

* problem: indicator_id column missing index

csirtgadgets/bearded-avenger,csirtgadgets/bearded-avenger,csirtgadgets/bearded-avenger,csirtgadgets/bearded-avenger