Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore indexes pricing

I have a question about Firestore Indexing pricing. I've setup an index in a collection for a "tags" array field with timestamp descending and wondering if this will cost anything. I am aware that the actual storage taken up by the index will cost something, but are there any other fees like firestore reads that should be taken into account?

Thanks so much!

like image 314
Rohin12 Avatar asked Aug 12 '20 20:08

Rohin12


People also ask

What is Firestore indexes?

A single-field index stores a sorted mapping of all the documents in a collection that contain a specific field. Each entry in a single-field index records a document's value for a specific field and the location of the document in the database. Cloud Firestore uses these indexes to perform many basic queries.

Is Google firestore expensive?

Cloud Firestore includes a no-cost tier to help you get started at no cost. After you exceed the usage and storage quotas for the no-cost tier, you're charged for the database operations you perform, the data you store, and the network bandwidth you use.

How long do firestore indexes take to build?

Indexes can take a few minutes to build, depending on the size of the query. After you create them, you can see your indexes and their status in the Composite Indexes section. If they're still building, the Firebase console includes a building status bar.

What file should be used for firestore indexes?

From the CLI, edit your index configuration file, with default filename firestore. indexes. json , and deploy using the firebase deploy command.


1 Answers

The only cost for indexes is their storage cost. There is no charge for accessing them or writing them, beyond the normal read/write costs for those operations (doc reads/doc writes/egress bandwidth).

The only other time I tend to think about the cost is when you run a query with no results. Such a query is charged as a single document read, and I mentally always map that one to "it's for reading the index". That's not really how it works though, as there is no charge for reading the index if there are resulting documents. But somehow it sticks in my mind, so... ¯\_(ツ)_/¯

like image 100
Frank van Puffelen Avatar answered Dec 01 '22 04:12

Frank van Puffelen