Mnesia Indexing & Query Optimization
Speed up Mnesia reads with secondary indexes, QLC queries, and smart table type choices to keep distributed lookups fast.
The Cost of Scanning
By default Mnesia can find a record fast only by its primary key. Searching by any other field forces a full table scan — slow on large tables. Indexes and queries fix this.
Secondary Indexes
A secondary index lets Mnesia look up records by a non-key field in roughly constant time, at the cost of extra storage and slightly slower writes.
All lessons in this course
- Mnesia Fundamentals & Schema
- Transactions & Data Manipulation
- Distributed Mnesia & Replication
- Mnesia Indexing & Query Optimization