Yes. The time I measure like I said is purely around statement.execQuery() call. Connection creation is not a factor here at all.
My database has 1.64 million rows and 4 queries are all selects, which are identical in both serial and parallel cases. In serial cases: Query 0 took 590 Query 1 took 431 Query 2 took 461 Query 3 took 440 In parallel cases: Queryer 3 query took 1552 Queryer 1 query took 1632 Queryer 2 query took 1783 Queryer 0 query took 1923 I don't understand why in 4 concurrent connection cases (already created not included in the timing) it takes more than 3 times longer to exec. a query. Thanks Haitao --- Mark Matthews <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > [EMAIL PROTECTED] wrote: > > > AFAIK, creation of connection from DB is > expensive. This is one of the > > reasons why we need connection pooling. > > > > Jonathan, > > While that might be true for other databases, it's > not true for MySQL > (connections are a few ms. to create). > > The real reason to use connection pooling is as a > resource limiter so > that you do not waste MySQL server-side resources > for threads that are > effectively doing nothing. > > Haitao's issue might be due to some locking in the > database server, thus > effectively serializing his four connections, or he > might not be > actually producing enough load to actually be able > to measure any > difference between his two approaches. If he could > post his DDL, the > relative size(s) of his data set(s) and the queries, > that would be > somewhere to start. > > -Mark > - -- > Mr. Mark Matthews > MySQL AB, Software Development Manager, J2EE and > Windows Platforms > Office: +1 708 332 0507 > www.mysql.com > > MySQL Guide to Lower TCO > http://www.mysql.com/it-resources/white-papers/tco.php > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (MingW32) > Comment: Using GnuPG with Thunderbird - > http://enigmail.mozdev.org > > iD8DBQFAxRgLtvXNTca6JD8RAjiSAJ0R5b6MNW0SdY5z4eJtmfgAV0ZMtgCgtGyn > 037apgXT972UAR3Khkg7ITI= > =4bja > -----END PGP SIGNATURE----- __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]