0.448 (25 Mar 2026)

25 March, 2026

This release adds automatic database indexing for fields used in computed field filter expressions.

Automatic Indexes for Computed Field Filters

Computed fields that use aggregate filters (SUMIF, COUNTIF, etc.) or quantifier predicates (ANY, ALL) generate SQL subqueries with WHERE clauses. The fields referenced in these filter conditions are now automatically indexed, preventing sequential scans on large tables.

For example, given this schema:

model Product {
    fields {
        name Text
        items Item[]
        activeItemCount Number @computed(COUNTIF(product.items, product.items.isDeleted != true))
    }
}
 
model Item {
    fields {
        product Product
        isDeleted Boolean @default(false)
    }
}

Keel now automatically creates an index on Item.isDeleted because it's referenced in the COUNTIF filter expression. Previously, querying activeItemCount on a Product with many Items could result in a sequential scan.

This works for all field types used in aggregate filter and quantifier predicate expressions, including enum fields:

model Lot {
    fields {
        transactions LotTransaction[]
        inboundTotal Decimal @computed(SUMIF(lot.transactions, lot.transactions.type == TransactionType.Inbound, lot.transactions.amount))
    }
}

Here, an index is automatically created on LotTransaction.type.

Learn more about computed fields.

Fixes and Improvements

For a full list of fixes and improvements, check out our GitHub releases page (opens in a new tab).

For any issues or feedback, please contact us at help@keel.so.

Thank you for using Keel!