FireSQL icon indicating copy to clipboard operation
FireSQL copied to clipboard

Are these queries executed online

Open uc-dve opened this issue 5 years ago • 1 comments

Do sql queries perform filtering on server-end(firebase-side) or client-side? Suppose I have 20000 items, then will all of them will be fetched offline then it will filter or it will fetch only those records which match the filter.

uc-dve avatar Jan 30 '20 07:01 uc-dve

It depends on the query. Single WHERE clauses will be performed on Firestore. WHERE clauses including the AND operator will also be performed on Firestore. WHERE clauses including the OR operator will be performed individually on Firestore, then the results of each will be merged on the client.

Read https://firebaseopensource.com/projects/jsayol/firesql/#how_does%20firesql%20work? and notice the statement "There's no direct way to perform an OR query on Firestore so FireSQL splits that into 2 separate queries".

RaduGrama avatar Feb 17 '20 22:02 RaduGrama