|
-
Mar 27th, 2008, 05:35 PM
#1
Thread Starter
Lively Member
limit of queries
Hi
I would like to know if there is a limit number of queries that can be made to a server os MYSQL in one connection.
I have a .net sw that I am developing and it produces 50 queries at the time for each object that I create.
The problem is that I will need 50 objects what will invilve 2500 queire in one go.
Will I have problems with it?
Regards
-
Mar 27th, 2008, 05:41 PM
#2
Re: limit of queries
You may end up having locking scenarios if they're all trying to update the same database objects. You should consider trying to minimize the number of queries being sent out, group them together. Set a timeout on your queries to avoid deadlocks.
-
Mar 27th, 2008, 05:43 PM
#3
Thread Starter
Lively Member
Re: limit of queries
They are only "select", no updates.
I cannot timed them because having data in "real time" is critical.
-
Mar 27th, 2008, 05:46 PM
#4
Re: limit of queries
The timeout was meant for update queries.
Use WITH(NOLOCK) when selecting.
Optimize your queries. Be efficient...
But I think you'll really need to do some stress testing to see effects. You ideally should not have problems with this as long as you're following general good practices. Return your connection to the connection pool afterwards...
-
Mar 27th, 2008, 05:58 PM
#5
Thread Starter
Lively Member
Re: limit of queries
Sorry for my ignorance... but I'm new at this :-(
What do you mean by "Use WITH(NOLOCK)" and by
"Return your connection to the connection pool afterwards..."
I made one update every 5 seconds and 50 selects each 5 seconds...
-
Mar 27th, 2008, 06:01 PM
#6
Re: limit of queries
NOLOCKS - http://articles.techrepublic.com.com...2-6185492.html
About 'returning', it just means that you should make sure you dispose of your objects properly once you're done with them.
-
Mar 27th, 2008, 06:11 PM
#7
Thread Starter
Lively Member
Re: limit of queries
Thank you!
so you think that if I use "good practices" I should have no problems with one update and 3000 selectss each 5 seconds.
-
Mar 27th, 2008, 06:17 PM
#8
Re: limit of queries
Oh, so there is one update. You did say there are no updates in post #3.
But yes, you get the general idea.
-
Mar 27th, 2008, 06:19 PM
#9
Thread Starter
Lively Member
Re: limit of queries
yes, I sayd but it was wrong.
So, should be no problem? What is the limit of number of selects?
-
Mar 28th, 2008, 02:51 AM
#10
Re: limit of queries
The limit is not the number of queries - it is the amount of work (which includes the complexity of queries, indexes that can be used, ...), and the hardware available (eg: speed and availability of processor/RAM/...).
Working it out is not easy or accurate, so your best bet (as suggested earlier) is to do some stress testing - try running what you want, and see how well it copes (and use Task Manager to see how much free CPU/RAM there is, as the workload is likely to increase over time).
-
Mar 28th, 2008, 12:09 PM
#11
Re: limit of queries
Coming at this from a different direction, do you really need to create that many queries? Generally, it's a good idea to use a few queries that return alot of information rather than alot of queries that return a little information. Is there anyway you can issue one query that gets the information for all the objects up front?
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|