Split Indexer_v2.get_elements SQL query
The new indexer for solr is already pretty smart, but there remains a single HUGE query at the beginning of the exec : get_elements
.
This simply does not work in production, on large corpus like horae, even with the Python iterator.
I think a simple and efficient fix would be to do the same query BUT on a subset of indexable elements, finding first all indexable elements on a given sort, then iterating over those chunks.