firestore documents retrieving very slow
Hi using this package https://github.com/kreait/laravel-firebase in laravel to fetch say 15,000 documents in a collection, the cloud-firestore component (https://github.com/googleapis/google-cloud-php-firestore) is installed and being used for the purpose. But why it's taking more than 40 seconds to fetch 15k documents right now?? to be clear i summarized this issue here in stackoverflow please help me asap
anyone plz??
I noticed when i use firease JS Sdk then it's faster. Are there any caching or other things in this php library and how can i overcome it?
Hi @mridulcs2012, this seems to be an issue with php grpc extension.
Over a collection (which extends from Query), there are 2 methods for getting the documents, listDocuments and documents.
listDocuments has some flags to increase the page size and make the calls faster (by reducing the number of calls) such as pageSize and resultLimit which fetches 20K documents in under 7 seconds. If you're using this function, consider using these flags.
documents method however supports no such flags. And I can reproduce the slow queries which seems to appear due to grpc extension.
@mridulcs2012 I reported this issue to Grpc on your behalf and it will likely take sometime before we get to its root cause. I will close this issue now since there are no action items.
We did the tests again and it seems it was a transient issue. All 20K documents were fetched in under <8 seconds.