Speed-up recursive by flushing index only once for all entries