473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Regarding Update/select Query

Hello grp!

i'm using INNODB tables which are using frequently .
if i fire a SELECT query which fetch major part of table it usually
take 10-20 seconds to complete.
in mean time if any UPDATE qry comes for a perticular row which is part
of SELECT qry i want to know that whether UPDATE will wait for
completing SELECT qry or not,
or it simply executing without bothering SELECT qry .

plz reply .

Jul 11 '06 #1
5 8301
First of all a select query on an innodb table should not take 10-20 seconds
to complete. There's something wrong somewhere. You can turn the slow query
log on to find out what is holding you up. You can ready about the slow
query and how to turn it on at www.mysql.com

Secondly, innodb uses what is called multi versioning which enables every
query to see their own version of the data it is trying to access (where for
read and/or update). Locking is rare and if it is needed then innodb uses
row level locking which means as long as you're not updating what you're
reading, performance should not effected (no wait).

Hope this helps.
-s
On 7/11/06 07:09, in article
11**********************@b28g2000cwb.googlegroups. com,
"pa************@gmail.com" <pa************@gmail.comwrote:
Hello grp!

i'm using INNODB tables which are using frequently .
if i fire a SELECT query which fetch major part of table it usually
take 10-20 seconds to complete.
in mean time if any UPDATE qry comes for a perticular row which is part
of SELECT qry i want to know that whether UPDATE will wait for
completing SELECT qry or not,
or it simply executing without bothering SELECT qry .

plz reply .
Jul 11 '06 #2
nope ! in some case seniario SELECT query takes major part of tables
...
and it takes more than 20 seconds . in b/w if we fire UPDATE qry
it also takes time to complete .
so i want to confirm that still innodb table has row level locking,
will SELECT query reads snapshot of DB without acquiring a read lock on
it and let UPDATE statment
do what row it want to update . or it will wait till SELECT qry
completes.
i dont know much about MySQL internal how it handle this queries . plz
help me !


Shawn Hamzee wrote:
First of all a select query on an innodb table should not take 10-20 seconds
to complete. There's something wrong somewhere. You can turn the slow query
log on to find out what is holding you up. You can ready about the slow
query and how to turn it on at www.mysql.com

Secondly, innodb uses what is called multi versioning which enables every
query to see their own version of the data it is trying to access (where for
read and/or update). Locking is rare and if it is needed then innodb uses
row level locking which means as long as you're not updating what you're
reading, performance should not effected (no wait).

Hope this helps.
-s
On 7/11/06 07:09, in article
11**********************@b28g2000cwb.googlegroups. com,
"pa************@gmail.com" <pa************@gmail.comwrote:
Hello grp!

i'm using INNODB tables which are using frequently .
if i fire a SELECT query which fetch major part of table it usually
take 10-20 seconds to complete.
in mean time if any UPDATE qry comes for a perticular row which is part
of SELECT qry i want to know that whether UPDATE will wait for
completing SELECT qry or not,
or it simply executing without bothering SELECT qry .

plz reply .
Jul 12 '06 #3
Yes, innodb utilizes row level locking. And also don't forget about multi
versioning like I said in the previous post.

Your updates like I said before should not take that long to return. You can
use background updating (I think you have to include some modifiers in your
sql statements) which will do the work behind the scenes; however, it
returns control to the calling program.
On 7/12/06 03:01, in article
11**********************@m73g2000cwd.googlegroups. com,
"pa************@gmail.com" <pa************@gmail.comwrote:
nope ! in some case seniario SELECT query takes major part of tables
..

and it takes more than 20 seconds . in b/w if we fire UPDATE qry
it also takes time to complete .
so i want to confirm that still innodb table has row level locking,
will SELECT query reads snapshot of DB without acquiring a read lock on
it and let UPDATE statment
do what row it want to update . or it will wait till SELECT qry
completes.
i dont know much about MySQL internal how it handle this queries . plz
help me !


Shawn Hamzee wrote:
>First of all a select query on an innodb table should not take 10-20 seconds
to complete. There's something wrong somewhere. You can turn the slow query
log on to find out what is holding you up. You can ready about the slow
query and how to turn it on at www.mysql.com

Secondly, innodb uses what is called multi versioning which enables every
query to see their own version of the data it is trying to access (where for
read and/or update). Locking is rare and if it is needed then innodb uses
row level locking which means as long as you're not updating what you're
reading, performance should not effected (no wait).

Hope this helps.
-s
On 7/11/06 07:09, in article
11**********************@b28g2000cwb.googlegroups. com,
"pa************@gmail.com" <pa************@gmail.comwrote:
>>Hello grp!

i'm using INNODB tables which are using frequently .
if i fire a SELECT query which fetch major part of table it usually
take 10-20 seconds to complete.
in mean time if any UPDATE qry comes for a perticular row which is part
of SELECT qry i want to know that whether UPDATE will wait for
completing SELECT qry or not,
or it simply executing without bothering SELECT qry .

plz reply .
Jul 12 '06 #4
yes my query is multitable update query in normal senario it takes less
than 1 second .
since it update only one row from each table which binded with foreign
keys ..

some times it takes time up to 40 sec which is not feasible now i want
to know whether
the select queries are takes lock or not .. these queires create temp.
table by select query .. some times it contains lacs of row in some
where conditions ..

one more thing these create temp. table from select takes lock on it
or not !

and what is background update can u till me ..

thanx for replying my qry.

Jul 12 '06 #5
It's a way for mysql to allow return of control to the calling program while
it's processing the data. I am not that good to have memorized all the
details; however, you can read about it on MySQL.com site. I remember that
you just add a modifier to the update.
On 7/12/06 12:09, in article
11**********************@p79g2000cwp.googlegroups. com,
"pa************@gmail.com" <pa************@gmail.comwrote:
yes my query is multitable update query in normal senario it takes less
than 1 second .
since it update only one row from each table which binded with foreign
keys ..

some times it takes time up to 40 sec which is not feasible now i want
to know whether
the select queries are takes lock or not .. these queires create temp.
table by select query .. some times it contains lacs of row in some
where conditions ..

one more thing these create temp. table from select takes lock on it
or not !

and what is background update can u till me ..

thanx for replying my qry.
Jul 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bill Agee | last post by:
I have a Select query which contains a field called AMWnum (long) which represents a sequence # of sorts. If I want to copy a row of information and paste it on the bottom, all is OK. I have...
1
by: septen | last post by:
Hi, I have a select query of 12 tables. The SQL code is as follows: SELECT OptChannelRangeAve.ChannelRangeMin, OptChannelRangeAve.ChannelRangeMax, OptChannelRangeAve.SampleAveraging,...
1
by: Greg Strong | last post by:
Hello All, Any reason why a select query that runs will not run as an update query? What I've done is created a select query that runs successfully. The query has several custom functions to...
3
by: phonl | last post by:
I am a vb6 ADO developer looking at vb.net 2005 and ADO2.net. I used the vb.net 2005 data wizard to bind some controls to a database. Now I want to run a select query and have the bound controls...
3
by: RAG2007 | last post by:
I'm using the QueryDef and Execute method to update a record in my MySQL backend. Problem: When the Passthrough update query is defined using QueryDef, it becomes a select query, and I cannot use...
4
by: msalman | last post by:
Hey guys, I'm trying to update some columns in a table using another table's data but there seems to be some problem due to join among the two tables. Here is my query Update...
5
by: MARIEDB2 | last post by:
Hello, I am struggling to build a query on a DB2 db wich does an update for multiple fields which are the result of a select query with where clause (using multiple tables in the condition). ...
4
by: fran7 | last post by:
Hi, I have a size field where the input is in quotes like 20" x 20" It writes to the database as I see the correct output in the webpage but when I open the record to update it it removes the quotes...
0
by: GEETHA LAKSHMI | last post by:
I want to use where conditions in both update and select query cmd1.CommandText = "Update AttRegister set Present= (Select count(Working) from Attendance where Attendance.Working='P' and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.