reintroduce an index map to make GetStreamId() faster