Indices

Indices

Article Type: Reference Audience: Developers Module: Data Models

Indices support the efficient execution of queries. By using indices the query can limit the results, resulting in faster performance instead of doing a collection scan. Indices can be defined on a single field or on multiple fields.

Index configuration

Multi-Field Index

The order of fields matters when defining a multi-field index. The index will contain references to documents sorted first by the values of the first field and, within each value of that field, sorted by values of the second field.

Unique Index

The Unique checkbox creates a unique index on the fields specified. This ensures the data is not duplicated and enforces uniqueness.

TTL Index

TTL indexes are used to automatically remove data after a certain amount of time. It's useful to add a TTL index where the data needs to persist for a finite amount of time. TTL indices are created on DateTime fields to determine the expiration seconds, and the data will be deleted from the collection after the specified seconds.

Partial Index

Partial indexes only index based on a specified filter expression. By indexing a subset of the documents in a collection, partial indexes have lower storage requirements and reduced performance costs for index creation and maintenance.

Partial index configuration

For example: If we have to create an index on a Log / History data model only when the status field is "Error", we can define a Partial Index using a Partial Filter Predicate as below:

{
    "status": {
        "_eq": "Error"
    }
}

See Also

    • Related Articles

    • Setting TTL on a Data Model / Table

      Article Type: Reference Audience: Developers Module: Data Models In designing solid applications, it is best practice to consider the data you'll be storing in Fuuz, and determine with your business users how long that data should be retained. In ...
    • Cascade Deletion

      Article Type: Reference Audience: Developers Module: Data Models Cascade deletion is a feature that ensures data integrity by automatically removing dependent records when a referenced record is deleted. This feature simplifies database management by ...
    • Data Model (Schema) Design Standards

      Article Type: Standard / Reference Audience: Solution Architects, Application Designers, Developers Module: Fuuz Platform - Data Model Designer Applies to Versions: 2025.12+ 1. Overview Data Model (Schema) Design Standards define the mandatory ...