Indexing Queries for Performance
Make Realtime Database queries fast and rule-compliant by declaring indexes with .indexOn, understanding why they matter, and avoiding the unindexed-query warning.
Why Indexing Matters
Querying with orderByChild works on small data, but as nodes grow, unindexed queries force the client to download and sort everything. That is slow and expensive.
Indexes tell Firebase to pre-sort data on the server for a given field.
The Unindexed Warning
Run an orderByChild query on a field with no index and Firebase logs a warning: it had to perform the sort on the client. In large datasets this is a real performance problem.
All lessons in this course
- Basic Data Queries
- Filtering & Ordering Data
- Data Pagination Techniques
- Indexing Queries for Performance