Oppz! Sorry for overlooking your timing method.

In this case, I believe if you run the query in four different machines
at the same time, the statistics should almost the same as running four
consecutive queries in the same machine.

I believe the multi-threading implemented in the JVM and the OS is not
"parallelly" the same!

Best Regards,
Jonathan Chiu
OOCL Logistics
Unit 1, 4/F., Sun Hung Kai Centre, 30 Harbour Road, Wanchai
TEL: 852 . 2990 0174
FAX: 852 . 28249017

-----Original Message-----
From: Haitao Jiang [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 08, 2004 12:06 PM
To: Mark Matthews; JONATHAN CHIU (ISD-OLAPL/HKG)
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Idea to speed up multiple jdbc connections?


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/ 


IMPORTANT NOTICE
Email from OOCL is confidential and may be legally privileged.  If it is not intended 
for you, please delete it immediately unread.  The internet cannot guarantee that this 
communication is free of viruses, interception or interference and anyone who 
communicates with us by email is taken to accept the risks in so doing.  Without 
limitation, OOCL and its affiliates accept no liability whatsoever and howsoever 
arising in connection with the use of this email.  Under no circumstances shall this 
email constitute a binding agreement to carry or for provision of carriage services by 
OOCL, which is subject to the availability of carrier's equipment and vessels and the 
terms and conditions of OOCL's standard bill of lading which is also available at 
http://www.oocl.com.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to