indices: WIP snapshot(broken)
indices: WIP snapshot(fixed)
indices: WIP snapshot(ok)
All index handling now seems to work without leaks.

The next, harder and trickier part is to automatically use existing
indices in a query.