vv619
vv619

Reputation: 117

Firestore Query/Performance

I am new to firestore, I am.confused with the pricing/shallow structure. Would like to know the better way of querying a set of data I have.

I have the data structure as follow:

My query will be usually getting data from (d) collection using 'where' clause.

Upvotes: 3

Views: 2640

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317808

You are only charged for the documents that are returned from a query or get operation, or documents that are skipped when using an offset (see under "managing large result sets"). Your queries are not charged extra for having lots of additional documents in a collection that are unread. But you are charged for that overall storage over time.

If you are trying to minimize your costs, you should minimize both the total number of document reads and overall storage. The database structure that satisfies this may not be the most effective one for your application, however. You may have to trade off between cost for queries, cost of overall storage, speed, and your own convenience. Only you are able to estimate these costs, unless you share the entire contents of your database with someone who can help you make that estimate.

Upvotes: 4

Related Questions