-
Notifications
You must be signed in to change notification settings - Fork 648
Does the SDK sort the result of a Firestore query on the client? #5313
Unanswered
DriesCruyskens
asked this question in
Q&A
-
Hello everyone,
We're currently having an issue where querying 1000s of Firestore documents takes a long time using the Android SDK (> 10 seconds), but is very fast using the iOS SDK (~1 second). We are using flutter which uses the underlying platform SDK. Here is the relevant call:
FirebaseFirestore.instance .collection('products') .where('zone', isEqualTo: zone) .orderBy('top', descending: true) .orderBy('dateType', descending: true) .orderBy('name') .snapshots()
What we note:
- iOS loads very fast and Android loads slow.
- If we remove the
.orderBy()calls, Android also loads as fast as iOS. - We always assumed the ordering is done Firestore side, since you need indexes for them. A slow network or Firestore response is NOT the issue since iOS loads fast.
This leads us to believe that there is something going on in the Android SDK specifically. Why would removing the .orderBy() calls make the Android SDK load them a lot faster then? Surely there is some sort of sorting going on locally?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment