1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Reducing the number of read ops in a query using indexes

    faunadbFaunaDB

    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