planLog

fun planLog(context: String, aggregate: String, plan: QueryIndexPlan): List<MongoQueryIndex>

The indexes of plan, the access attributes of aggregate in context, on its log collection: led by the tenant, each attribute's document path (multikey for a multiple one), partial on the streams ({version: {$exists: true}}), which every events query asks for, so it can use them; the log's placeholders hold no version. No tie-breaker ends them: they narrow the streams an access policy lets a reader see, and are not read for an order, which for an events query ends with the stream key (tenant, aggregate, version).

A built-in attribute's index (owner, space) is instead the sparse index of its tenant-scoped key (access_key.owner, me.ahoo.wow.mongo.MongoAccess.keys): a stream without the attribute adds no entry, an equality or an $in the compiler maps to the key reads the tenant's entries alone, and an $or branch can use it, which a partial index whose filter only the branch implies it cannot. A negation and isNull read the attribute itself, by no index of its own.