I have a Firebase with a child named lines
. lines
contains about 500k records, each with eight key/value pairs.
When my app loads, it trie
Should I expect limitToLast() to take increasing longer as the number of records under lines goes up?
Yes. Keep reading for why that is.
If so, I can try and cull the records over time
That is indeed the recommended solution.
but I was under the impression that the limitToLast() query would only grab what is specified.
It will only send the children matching your query to the client. But to know which children to send it needs to consider all of them. So while limitToLast()
can be used to reduce bandwidth, they don't reduce "disk IO" on the Firebase servers.
I put "disk IO" in quotes there, because there are many factors involved here. But in general: giving the database more nodes to consider, will make it slower. Or the opposite: if you give the database less work to do, it will be done with that work faster.