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 2008
»
T-SQL (SS2K8)
»
FASTFIRSTROW Hint
FASTFIRSTROW Hint
Rate Topic
Display Mode
Topic Options
Author
Message
Jason-299789
Jason-299789
Posted Thursday, January 10, 2013 2:57 AM
SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 1:30 AM
Points: 803,
Visits: 2,124
I've been doing a review of a DW project and noticed that several of the views use a WITH (FASTFIRSTROW)
I need to start putting together a list of issues, but I'm unsure how to put this down as a possible issue, the first issue is a future compatibilty as I'm aware that the FASTFIRSTROW hint is being deprecated and replaced with OPTION(FAST n).
It is also my understanding that while you can get data being returned faster from the initial execute you can also end up with a sub optimal plan being used, is this correct?
Are there any other issues that anyone can point out.
_________________________________________________________________________
SSC Guide to Posting and Best Practices
Post #1405298
HowardW
HowardW
Posted Thursday, January 10, 2013 3:27 AM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 9:42 AM
Points: 1,036,
Visits: 7,680
The views are used to populate the DW, rather than for end user queries?
Yes, they can definitely produce sub-optimal plans as by definition, they sacrifice overall execution time in order to get the first rows out quicker. So generally, unless statistics are incorrect or there's another reason that it's "tricking" the optimiser into picking a better plan, there's nothing to gain and much to lose from the hint.
The hint is generally only used for queries that an end-user is receiving the results for and implements client-side paging, to give the appearance of a more responsive system.
Post #1405309
Jason-299789
Jason-299789
Posted Thursday, January 10, 2013 3:33 AM
SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 1:30 AM
Points: 803,
Visits: 2,124
These are 'end user' views, and used to feed SSAS and reports, the tables are pretty small with around 100-150 million rows in, although it seems some of the developers have heard the 'good news' about this and it seems to be creeping into other areas as well.
I've done some 'prelim' testing using the views with and with out the hint and the results are interesting, in that data is returning around 4 times fast without the hint.
_________________________________________________________________________
SSC Guide to Posting and Best Practices
Post #1405313
GilaMonster
GilaMonster
Posted Thursday, January 10, 2013 3:44 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 2:59 PM
Points: 37,731,
Visits: 29,995
Jason-299789 (1/10/2013)
It is also my understanding that while you can get data being returned faster from the initial execute you can also end up with a sub optimal plan being used, is this correct?
Correct. The point of the hint is that you want to ensure that the first few rows arrive fast and you don't mind if then entire resultset takes longer than it would otherwise. The optimiser avoids blocking operations (like sorts or hashes) as far as possible, even if they may be the lowest cost option.
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 #1405320
Jason-299789
Jason-299789
Posted Thursday, January 10, 2013 4:03 AM
SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 1:30 AM
Points: 803,
Visits: 2,124
Thanks Howard (sorry I forgot in my first reply) and Gail.
_________________________________________________________________________
SSC Guide to Posting and Best Practices
Post #1405328
« 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.