Reducing the number of read ops in a query using indexes

InstructorChris Biscardi

Share this video with your friends

Send Tweet

The FaunaDB hosted product pricing charges you based on read ops (in addition to write ops, storage, and data transfer). This can make it important to reduce the number of read ops in a heavily used query to stay within your expected limits on a given day.

Map(
  Paginate(Match(Index("all_customers"))),
  Lambda("X", Get(Var("X")))
)
Paginate(Match(Index("all_customers_with_fields"))),

The number of read ops can be found by inspecting the headers for a given query.

X-Read-Ops: 4