It depends on the situation. In general, it’s better to have a simple SQL query and a complex front-end, rather than a complex SQL query and a simple front-end.
A complex SQL query can be resource-intensive and may take longer to execute, which can slow down the performance of your application. On the other hand, a simple SQL query can be executed quickly and will not put as much strain on your system’s resources.
By keeping the SQL query simple, you can minimize the load on the database and ensure that the application performs well. Additionally, a simple SQL query is easier to maintain, debug and update.
It’s important to note that the best way to optimize performance is to take a holistic approach and consider the entire application stack, including the database, the server, and the front-end. It’s a trade-off between performance and usability, and you will have to decide which is more important for your particular use case.
Last modified: January 13, 2023