Project background: the intranet OLAP application, specifically, is a variety of statistical charts for leaders to see. The project concurrency is small, so multiple threads can be used for a single request. The bottleneck is that the statistics of SQL is too slow (postgresql used)
problem description: now there are 5 slow sql, we want to optimize performance. Scenario 1 is that the web server sends a single-thread serial request to the database to check 5 sql,. Scenario 2 is that the web server has 5 threads to send requests to the database to check 5 sql.
question: ignoring the network IO delay saved by solution 2, can it be faster for scenario 2 to check 5 sql?
my understanding is that option 2 can"t be faster. The reason is:
the slow part of the database is the disk IO,. For the database, one connection to check 5 sql or 5 connections to check 5 sql should always be serially scanned 5 times, which should not be optimized?
is this understood correctly? Will 5 threads be faster?