multiple attach to same session, better handling of not yet created indexes

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>