Answer the question
In order to leave comments, you need to log in
Is it appropriate to continuously keep the connection to the database until the end of the rendering of the web page?
For example, a page needs to perform 10-20 (sometimes more) database queries when rendering the page. Making one large query is too tedious and inconvenient, and 10 small queries are executed very quickly if you do not disconnect from the database every time. Actually the question is whether there is an alternative or is it okay if the connection lasts for two seconds continuously?
Answer the question
In order to leave comments, you need to log in
Use the pool to maintain connections with MySQL, you don't need to establish a new connection, use the old one
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question