Need information on creating a connection pool to the database (irrespective of the database) , and how efficient they are? What are the conditions where they can enhance pe
Creating a database connection may or may not be an expensive operation, depending on your environment and what you intend to do with it.
If you're going to run a single very easy query, then connecting probably takes as long (or longer) than the query.
Some databases have a much bigger connection overhead than others; if tuned correctly, mysql should have very little (above the time to make a tcp connection and do the protocol handshake). However, if latency to your server is very high, even this can be quite significant (particularly if you intend to do only a few queries).
If you're planning to do, say, 100 queries, or a few really slow queries, then the connection time disappears into insignificance.
In generally I'd say open a new connection each time until you can demonstrate that it's a real performance problem. Using connection pooling can lead to BUGS, which we don't like: