[Firestore] Very slow GET requests
@ehsannas is already working on this.
Since Jul 15, 2025.
Assessment
This issue has not been assessed yet.
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: Linux
- Firebase SDK version: 13.4.0
- Firebase Product: Firestore
- Node.js version: 22
- NPM version: 10.9.2
[REQUIRED] Step 3: Describe the problem
We have simple Firestore queries, filtering on simple properties.
When fetching from backend (nodejs), it takes a very very long time.
Same query using frontend libraries takes 1% of the time.
Explain query shows that the backend query is fast, but the result takes forever to download.
If we use Firebase frontend client libraries, the same query result is loaded 50x faster.
As an example, a query with result set of 100 documents took 4 seconds to fetch with firebase-admin
1000 documents took 21 seconds to fetch with firebase-admin
This is not a network issue, as we can run the same queries on backend and frontend from same hardware, and get 50x faster results in the client libary, compared to firebase-admin.
Any idea what it could be?
It is NOT the query that is the issue, using tools we can see that correct index is used.
We can also see that result set is streamed right away.
But the actual fetching of result data takes forever with this library.
Thanks in advance
Here is a snippet from a query with result set of 1000. We can see that result is immediately starting to download.
Firestore (7.11.0) 2025-06-09T14:36:33.255Z CNebO [ClientPool.acquire]: Creating a new client (requiresGrpc: false)
Firestore (7.11.0) 2025-06-09T14:36:33.310Z ##### [clientFactory]: Initialized Firestore GAPIC Client (useFallback: rest)
Firestore (7.11.0) 2025-06-09T14:36:33.311Z CNebO [Firestore.requestStream]: Sending request: {"parent":"projects/fastorder-prod/databases/(default)/documents/company/gorilla","structuredQuery":{"from":[{"collectionId":"orders"}],"where":{"fieldFilter":{"field":{"fieldPath":"orderStatus"},"op":"NOT_EQUAL","value":{"stringValue":"ARCHIVED"}}},"limit":{"value":2}}}
Firestore (7.11.0) 2025-06-09T14:36:34.856Z CNebO [Firestore.requestStream]: Received response: {"document":{"fiel.... rest of result set
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-admin-node
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 comments · 1 assignee ·
-
api: messaging
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Difficulty 5/5 Over a week Newbie friendliness 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comment · 1 assignee ·
All issues in firebase/firebase-admin-node
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100