I need some clarification about Firebase query costing, and I have user node like below JSON (it's not in the correct format)
"User": {
"user1": {
"filter1": "...",
"filter2": "...",
"filter3": "...",
"filter4": "..."
},
"user2": {
"filter1": "...",
"filter2": "...",
"filter3": "...",
"filter4": "..."
},
"userN": {
"filter1": "...",
"filter2": "...",
"filter3": "...",
"filter4": "..."
}
}
Now, the query is
APPROACH 1
Userref.orderByChild("filter1").equalsTo("string").addListenerForSingleValueEvent;
This query returns only the data which has filter1 value is "string" (if i am not wrong). For example in 100 users, if firebase query matches only 5 then query returns only 5 users.
But I need some more filter, but more than one filter is not possible according to official document.
for this, APPROACH 2 I used
Userref.addListenerForSingleValueEvent();
this will return all 100 users data. and all filter set on the client-side.
Now the question is in 1st approach query returns only 5 users and, in 2nd approach query returns 100 users,
So can its query-based costing change? and if no. of users goes to 100 000, then data return timing (loading time) will be the same or different in both approaches?