How to efficiently query `findAll () `with spring-data-mongodb?

question

    In
  • business, all tables in the database need to be queried and statistically analyzed and shown in the echats figure. The previous data is fine when the data is small, and the cache can barely support the column
  • .
  • now there is nearly 1 million data in the database. As a result, the execution time of findAll () is slow, which takes about 3 minutes
  • .
  • are there any other ideas to implement this business
I hope you bosses can give us some advice!

hitting the index is the basic principle of database usage. I don't know what kind of query has been executed, so there is no way to optimize it for you.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd997a-39549.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd997a-39549.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?