473,386 Members | 1,817 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,386 software developers and data experts.

Query queued

DzU
Hi all,
I've a problem with sql server 2000 EE.

I've a DB with a table with lots of records. I run a SELECT from
query analyzer, and I've results in 10 seconds. Perfect.

When I run the query two times in the same table, seems like
it been queued. Result in 20 seconds.

With another query, I've result in 40 seconds. If I run this query 2
times, I've results in 80 seconds.

How can it be? Does Sql Server queue the query?
thanks, and sorry for bad english! :D
Apr 3 '07 #1
3 1720
DzU (cl*****@scartozzetto.it) writes:
I've a DB with a table with lots of records. I run a SELECT from
query analyzer, and I've results in 10 seconds. Perfect.

When I run the query two times in the same table, seems like
it been queued. Result in 20 seconds.

With another query, I've result in 40 seconds. If I run this query 2
times, I've results in 80 seconds.

How can it be? Does Sql Server queue the query?
I'm really sure with what you mean that you run the query twice. If you
do:

SELECT ... FROM tbl WHERE ...
SELECT ... FROM tbl WHERE ...

it's not entirely surprising that this takes twice the timeas ii would be
to run the query a single time. (Alhough often, it's faster the second
time, since the data is in cache the second time.)

Or do you mean that you run the queries in parallel from two different
sessions?

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 3 '07 #2
DzU
Il Tue, 03 Apr 2007 22:04:06 +0000, Erland Sommarskog ha scritto:
it's not entirely surprising that this takes twice the timeas ii would
be to run the query a single time. (Alhough often, it's faster the
second time, since the data is in cache the second time.)

Or do you mean that you run the queries in parallel from two different
sessions?
Yes, I run the query in two different session. It seems that the second
wait for the first and then start running.

It's a strange behaviour.
Apr 4 '07 #3
DzU (cl*****@scartozzetto.it) writes:
Yes, I run the query in two different session. It seems that the second
wait for the first and then start running.
And the first window returns in 20 seconds, and the second 20 seconds later?

Unless you are using some XLOCK hints, I would rather suspect the network
communication. Or are you running these queries on the local server? What
happens if you run the two queries from two different clients.

On thing you could try is from a third window run sp_who2, and study the two
processes. I would expect both to consume CPU and physical IO.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 4 '07 #4

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

Similar topics

8
by: san | last post by:
Hi, I wanted to know if this is possible and if so, how do I do it. Say, I have a query "SELECT * FROM Table WHERE Column="some_value". This executes on a very large data set and I would like...
0
by: zahari | last post by:
Hi, Im facing a problem with .net Pool and Queued component the problem was it not releasing the Object I can see in my MMC console there are lots of active calls even after setting to nothing...
0
by: Aaron Pfeifer | last post by:
I've written an application in c# that will eventually crash due to libraries outside the scope of the application, usually with the following error in the event log: --- Reporting queued...
2
by: Ollie | last post by:
I have a COM+ queued component written in C# and I'm trying to get it to run under the 'NETWORK SERVICE' account, it runs perfectly fine under the 'interactive user' as this happens to be a admin...
5
by: Girish G | last post by:
I am trying to invoke a queued component and to my surprise the call succeeds locally but fails when the component resides on a separate box. Both the machines (client and server) in use have...
3
by: mike | last post by:
Hello, I am new to XPATH and am having a hard time selecting some nodes. I want to select all the record nodes where Status = 'Unprocessed' or 'Queued' (that part I can get) but additionally I...
2
by: dmagliola | last post by:
Hello all, I'm experiencing a problem with ASP.Net for which I can't find a reasonable explanation, or any information. I'm currently developing an application that, through AJAX, asks the...
1
by: FrankEBailey | last post by:
Hi, I have a limited number of ad slots on my website, let's say there are 5. I have lots of people wanting to advertise in those slots, let's say there are 100. They each join the queue for an...
11
by: BillGatesFan | last post by:
I have a web service which calls a .NET queued serviced component in COM+. I turned statistics on for the component. I call the component 10 times, 10 objects get created but they do not go away....
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.