There are multiple issues that might affect
1. Your server speed.
2. Your server bandwidth. High bandwidth from server loads data faster as speed is more
3. To check above points check the same code and database in local and see if its faster. if it is then the above 2 points must be checked if it does not that you need to do some normalization to database and design it properly for effecient processing