Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 Performance Tuning
»
Performance in using Select "TOP 5000000 ..."...
Performance in using Select "TOP 5000000 ..." in sql
Rate Topic
Display Mode
Topic Options
Author
Message
ricky.wong
ricky.wong
Posted Wednesday, August 12, 2009 8:21 AM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, November 11, 2009 8:26 AM
Points: 1,
Visits: 15
Can anybody help me in trying to resolve the performance issue in a simple sql using "select top 5000000 " with order by clause in sql server 2005? It ran 2 secs in development database but ran 12 mins or more in production datable using the exact sql. However, if I reduce the select top value from 5000000 to 50000, it ran about 4 secs. Regardless, can anyone give me a clue why the exact sql performance timing is different? I am new sql server database...are there database parameters setting the DBA need to be look at? Any help is much appreciated. Thank you.
Post #769344
Lynn Pettis
Lynn Pettis
Posted Wednesday, August 12, 2009 8:34 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 10:18 AM
Points: 21,620,
Visits: 27,454
Please read the second article in my signature block regarding asking for assistance on performance problems. Based on your post, there really isn't much we can do to help you.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #769356
GilaMonster
GilaMonster
Posted Wednesday, August 12, 2009 9:33 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 10:47 AM
Points: 37,729,
Visits: 29,990
TOP 5000000? That's an aweful lot of rows to be 'limiting' a result set to. What's the purpose of that TOP clause?
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #769419
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.