Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Does the SDK sort the result of a Firestore query on the client? #5313

Unanswered
DriesCruyskens asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /