4 messages in com.mysql.lists.mysqlRe: Select Query taking time
FromSent OnAttachments
Ratheesh K J24 Jul 2006 01:05 
Duncan Hill24 Jul 2006 01:05 
Duncan Hill24 Jul 2006 01:08 
Martin Jespersen24 Jul 2006 04:16 
Subject:Re: Select Query taking time
From:Duncan Hill (dunc@icritical.com)
Date:07/24/2006 01:08:41 AM
List:com.mysql.lists.mysql

On Monday 24 July 2006 09:06, Duncan Hill wrote:

On Monday 24 July 2006 09:05, Ratheesh K J wrote:

Hello All,

I run a select query to see its speed. It took around 5 seconds. Now i run the same query simultaneously twice usng two instances of the client tool. It took 10 seconds for both the queris to complete. Its not 5 secs + 5 secs. Both the queries were running till 10 secs when i saw using

In the case of a single disk serving up the data, two simultaneous queries for the same data will cause the disk to go back and forth trying to satisfy each query. Even with a mirrored pair of disks, you're going to have problems unless you have a very intelligent disk controller that can split the requests across the two disks.

Forgot to add - do the queries require table locks? If so, the first one is going to lock the table, run in 5 seconds, unlock. Then the second one, and then the third. Assuming no query cache.