作者:zeror01_119 | 来源:互联网 | 2023-09-08 15:21
- Laravel-mongodb Version: laravel: 5.7, jenssegers: 3.4
- PHP Version: 7.2
- Database Driver & Version: mondodb: 3.4
simple queries like User::where('role', 'some_role')->where('name', 'some name')->orderBy('created_at', 'desc')->paginate(15); takes forver and time out occours with over 2 million records even after indexing the fields.
Steps to reproduce
- populate users collection with 25 lack records
- perform the above query
- query puts a load on db server and queries start choking
Expected behaviour
Query should get executed, the same query, when changed to raw mongo query, and run on mongo shell, returns results in few milliseconds.
Actual behaviour
Query fails
Question :
Is this package recommended for application with millions of users and has huge data?
Kindly help here
Logs:
Insert log.txt here (if necessary)
该提问来源于开源项目:jenssegers/laravel-mongodb
Hello,
I've just had a chance to work with 520M of documents and everything works fine.
Query should get executed, the same query, when changed to raw mongo query, and run on mongo shell, returns results in few milliseconds.
Run that in reverse. MongoDB caches the same queries and that's the only reason why it's being fast.
Also, you haven't given any information about your setup (sharded/replicas) and server information (can it handle fast so much information?).
Closing as it's not related / can't reproduce.
Thanks!