Pricing examples Stay organized with collections Save and categorize content based on your preferences.
This page includes examples of how billing units are calculated insome of the most common scenarios. Note that each query might differ in dataprocessed based on factors such as the query plan, the shape of the data,and the indexes available.
We recommend using theQuery Explain feature to betterunderstand the cost and performance of your specific queries.
Read operations
Most read operations entail either performing a point read of a specificdocument or scanning a rage of data based on an identifier.Read operations consume read units. Read units are calculated in 4 KiB tranches. See the following examples.
Point reads
Example billing for point reads:
- Point read of a single 1 KiB document. Consumes: 1 read unit
- Point read of a single 4 KiB document. Consumes: 1 read unit
- Point read of a single 1 MiB document. Consumes: 256 read units
- Point read of 100 documents, 1 KiB each. Consumes: 100 read units
Scanning
The following examples include scenarios that scan documents or index entries.
Scanning Documents
- Query which scans 100 documents, 1 KiB each. Consumes: 25 read units
Scanning indexes
The scanning cost, in terms of bytes, is the same regardless of whether it is adocument or index being scanned. However, index entries are often smallerin size. As a result, they can often provide a more cost effective way of scanning data.
- Query which scans 100 index entries, 1 KiB each. Consumes: 25 read units.
- Query which scans 100 index entries, 128 bytes each. Consumes: 4 read units.
Minimum document or index entry size
In certain situations it may not be necessary to read the contents of adocument or index entry to satisfy a query. This includes simple count querieslike counting the total number of documents in a collection.In these situations, a minimum cost of 32 bytes applies per item scanned.
- Count the number of documents in a collection. The query scans 1000items in the collection. Consumes: 8 read units.
Combination of scanning and point reads
Many queries perform a combination of scanning and point reads to satisfy anoperation.
- Query which scans 128 index entries, 256 bytes each and performs apoint read of 128 documents, 4 KiB each. Consumes: 136 read units, comprised of:
- 128 read units for point reads
- 8 read units for index scans
Query Explain
Query Explain helps you understand how the databaseexecutes your queries. The details provided can help you optimize yourqueries.
The following costs apply when using Query Explain:
- Query Explain which executes the query: Query cost applies.
- Query Explain using plan only option. Consumes: 1 read unit (minimum cost of a query)
Write operations
Write operations (creates, updates and deletes) are charged based on thesize of the documents and indexes being created, modified, or deleted during theoperation. Write operations consume write units. Write units are calculated in 1KiB tranches.
Simple write operations, like update by document ID, only incur the cost of the writes.Write operations which require querying to satisfy the operation willadditionally incur the read costs associated with the query.
See the following examples.
Creates
- Create a new 10 KiB document with no indexes. Consumes: 10 write units
- Create a 1 KiB document with 1 index entry of 256 bytes on the collection. Consumes: 2write units
Updates
- Find a 10 KiB document by document ID and update with no indexes on thecollection. Consumes: 10 write units
- Find a 1 KiB document by document ID and update 1 field with 1 index entry of 256 bytes. Consumes: 3 write units. Note: Updating an index entry in thissituation consumes 2 write units – one to delete and one to recreate theindex entry.
- Find a 1 KiB document by document ID and update nothing (no changes). Consumes: 1write units (the minimum write costs)
- Query all 1 KiB documents in a collection, which scans 1,000 documents, andinsert a new 256 bytes field with no indexes on the collection: 1000 readunits and 1000 writes units.
Deletes
- Delete a 1 KiB document, which has 1 index on the collection. Consumes: 2 write units
- Delete a 1 KiB document, which has no indexes on the collection. Consumes: 1 write unit
Index builds
Index builds charge for the index entries created or modified during the buildoperation. These costs are incurred anytime an index definition is added orremoved. The index entries are billed identically to writes incurring 1 writeunit per 1KiB.
- Create a new index for a collection containing 500 documents, indexentries created are 1 KiB each. Consumes 500 write units.
- Delete an existing index for a collection containing 500 documents,index entries deleted are 1KiB each. Consumes 500 write units.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-06 UTC.