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
»
Administering
»
Query to long time running........
Query to long time running........
Rate Topic
Display Mode
Topic Options
Author
Message
Jorge Mendes
Jorge Mendes
Posted Friday, November 02, 2012 5:36 PM
SSC Journeyman
Group: General Forum Members
Last Login: Tuesday, December 18, 2012 12:34 PM
Points: 76,
Visits: 88
Hello,
I've got to troubleshoot the following query but i'm lost since they've got one select "*" in the beginning of the query and in the where clause they got a like that i think its the problem.
I'm limited too in the field of the date but .... dont know how to check it!!! (i think
).
Can anyone tell me what should i do or should i do not do anything?
Sorry, thanks and regards
SELECT * FROM tblname WITH(NOLOCK)
WHERE FiledDate > '2012-11-01 00:00:00.000'
AND FieldDescr LIKE 'xptonumber%'
ORDER BY FieldCodDesc DESC
Post #1380638
Luis Cazares
Luis Cazares
Posted Friday, November 02, 2012 5:45 PM
SSC Eights!
Group: General Forum Members
Last Login: 2 days ago @ 5:52 PM
Points: 960,
Visits: 1,921
You should take a look at Gail's article with suggestions to post performance issues.
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
It might not affect performance, but you should beware of the dangers of using NOLOCK.
Luis C.
Please don't trust me, test the solutions I give you before using them.
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1380640
Evil Kraig F
Evil Kraig F
Posted Friday, November 02, 2012 5:48 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 5:44 PM
Points: 5,677,
Visits: 6,124
If you take a look in my signature for the link regarding indexes/tuning, we can help you further.
The like is SARGable, no big deal. As is the date. The order by be hurting depending on the # of rows returned, and because you've got two non-equality conditions no index can cover both.
I don't see anything particularly wrong with the query as long as your end users are prepared for bad data from the use of NOLOCK on occassion.
- Craig Farrell
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions
|
Forum Netiquette
For index/tuning help, follow these directions.
|
Tally Tables
Twitter: @AnyWayDBA
Post #1380641
Bhuvnesh
Bhuvnesh
Posted Monday, November 05, 2012 3:21 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
Any index on FiledDate OR FieldDescr column ? if not then create tow separate indexes.
-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #1380952
« 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.