Hi Mathias,
Thanks a lot for your comments. In MS SQL we have something which can
achieve this very simply:
select Top 1 * from Table1 with (updlock,readpast)
I am looking for something exactly similar to this in MySQL. Creating temp
tables will not work for me as the no of users for the system could be as
high as 500.
Regards,
Ramesh G
On Fri, 13 May 2005 08:19:32 +0200, <mfatene@stripped> wrote:
> Hi,
> you're ooking for the opposite of what can be done. One can select in
> share mode
> or for update :
> http://dev.mysql.com/doc/mysql/en/innodb-locking-reads.html
>
> this prevents data from being incoherent. If you want skip waiting for
> locks,
> you can make for each user a temp table containing the result of the
> select
> without for update :
>
> - create temporary table tempo select ... from table
> - update tempo
> - update table where
> - drop tempo
>
> even then, the table will be locked for the update statement. But you
> can test
> it.
>
> Mathias
>
> Selon Ramesh G <gramesh@stripped>:
>
>>
>> Hi All,
>>
>> Is there a way by which I can tell the Mysql to ignore the rows that are
>> locked by someone else and take the next available record. The problem
>> is,
>> I have a Query like this:
>>
>> Select * from Table1 where Fld1=2 FOR UPDATE Limit 1
>>
>> I will have multiple clients running this same query with the same where
>> clause. For the second instance of the query mysql seems to wait till
>> the
>> transaction of the first instance gets completed. This makes this query
>> slow as the time taken for the transaction to complete is somewhere
>> between 1 and 1.5 seconds.
>>
>> Regards,
>> Ramesh G
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: http://lists.mysql.com/mysql?unsub=1
>>
>>
>
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/