inmake DOCS
Docs / API / Indexes

Indexes

Every composite index the platform keeps and the built-in query keys, generated from the index file.

Composite indexes#

Composite indexes exist only for the platform-owned collections — the collection groups below, shared by every project. Store collections never get one: a listing that filters and sorts runs on a query key instead. The file is deployed per core project (Production and Demo) and reaches a Space cloud on its next Re-check.

ascending descending array-contains__name__ implicit, appended by Firestore
Collection groupFields, in index orderQuery scope
backups1 indexkindcreated__name__collection
log3 indexesstatusduration__name__collection
statustimestamp__name__collection
statustimestamp__name__collection
logs1 indexlevelat__name__collection
orders6 indexes__name__collection
payment.servicestatus__name__collection
shipping.servicestatus__name__collection
statustimestamp__name__collection
statustimestampinvoice.total__name__collection
statustimestamp__name__collection
products17 indexes__name__collection
categoriesname__name__collection
categoriesprice.price__name__collection
categoriesprice.price__name__collection
categoriestimestamp__name__collection
statuscategoriesname__name__collection
statuscategoriesprice.price__name__collection
statuscategoriesprice.price__name__collection
statuscategoriestimestamp__name__collection
statustagsname__name__collection
statustagsprice.price__name__collection
statustagsprice.price__name__collection
statustagstimestamp__name__collection
tagsname__name__collection
tagsprice.price__name__collection
tagsprice.price__name__collection
tagstimestamp__name__collection
records1 indexstatustimestamp__name__collection
stock4 indexes__name__collection
ownersupply__name__collection
ownersupply__name__collection
storessupply__name__collection

Built-in query keys#

A key serves == on its leading fields and a range or sort (either direction) on the last one, marked . The platform maintains a computed _k.{name} field per document and rewrites a matching query onto it, so none of these needs a composite index.

Content collections#

Derived from the collection's schema template in schema order ("first" = first in the schema), up to 5 per collection on their own budget. Number, boolean and array fields derive nothing.

Built-in keyFieldsRuleWorked example
status_timestampstatustimestampevery collection, with or without a template — "published, newest first"recipes → status_timestamp
status_{date}status{date}one key per datetime field, for the first two — "published articles by publish_date", date rangesarticles with publish_date → adds status_publish_date
{enum}_{date}{enum}{date}the first enum field; the date is the first datetime field, else timestamp — "category X, newest first"recipes with an enum category, no date → category_timestamp
status_{enum}_{date}status{enum}{date}the same, published onlyrecipes → status_category_timestamp

So recipes (an enum category, no date field) gets status_timestamp, category_timestamp, status_category_timestamp; articles with a publish_date gets status_timestamp, status_publish_date.

Products mirror#

The per-locale data/{locale}/products mirror — what a storefront lists — has a fixed set. Its category and tag pages (an array filter with a sort) run on the products composites above instead; one array filter per query.

KeyFields
status_pricestatusprice.price
status_namestatusname
status_timestampstatustimestamp

Declared keys#

Beyond the built-ins a collection declares up to 8 keys of its own (keys: {"<name>": ["<field>", …]}, 1–4 fields each) on the collection row; null under a built-in's name disables that built-in, a list under the same name replaces it. Shape, limits and the query_key_required answer: API overview › Query keys.

Generated from firestore.indexes.json and PRODUCT_QUERY_KEYS at build — 33 composite indexes, 3 built-in product keys.