Resolve "On IMT Instance : Error message or crashes when changing the status of terms in large batch"
Ref #505
This is an experimental fix of the query that slowed down IMT in issue #505 (postgres poor config also slowed it down).
This terms query: https://imt.sub.gargantext.org/#/lists/pk@imt.sub.gargantext.org/132587 takes 11-13 seconds now. The new query, from my tests in psql, should take around 5s.
The improvement isn't 2x always like that. E.g. for https://imt.sub.gargantext.org/#/lists/pk@imt.sub.gargantext.org/132530 it's around 2.5s for old query vs 1.8s for the new one.
Still, it should be faster overall, and less complex that the older one.