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
»
Article Discussions
»
Article Discussions by Author
»
Discuss Content Posted by Robert Cary
»
SQL Server 2005 Paging – The Holy Grail
63 posts, Page 7 of 7
««
«
3
4
5
6
7
SQL Server 2005 Paging – The Holy Grail
Rate Topic
Display Mode
Topic Options
Author
Message
peter-757102
peter-757102
Posted Tuesday, December 07, 2010 2:50 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, May 10, 2013 10:03 AM
Points: 287,
Visits: 1,900
SwePeso (12/6/2010)
It seems the dual TOP/ORDER BY was the most efficient approach by the time.
I tested the new Denali OFFSET/FETCH and I got the exact same number of reads for @StartRow = 5000, but 2 ms instead of 4 ms.
SELECT Number
FROM dbo.TallyNumbers
ORDER BY Number
OFFSET @StartRow - 1 ROWS
FETCH NEXT 50 ROWS ONLY
This is unreleased SQL Server 2011 functionality only, right?
Post #1031092
Dave Ballantyne
Dave Ballantyne
Posted Tuesday, December 07, 2010 3:27 AM
SSCommitted
Group: General Forum Members
Last Login: Friday, May 10, 2013 4:07 PM
Points: 1,943,
Visits: 8,227
SwePeso (12/6/2010)
It seems the dual TOP/ORDER BY was the most efficient approach by the time.
I tested the new Denali OFFSET/FETCH and I got the exact same number of reads for @StartRow = 5000, but 2 ms instead of 4 ms.
SELECT Number
FROM dbo.TallyNumbers
ORDER BY Number
OFFSET @StartRow - 1 ROWS
FETCH NEXT 50 ROWS ONLY
My take on the Denali paging....
http://sqlblogcasts.com/blogs/sqlandthelike/archive/2010/11/10/denali-paging-is-it-win-win.aspx
and
http://sqlblogcasts.com/blogs/sqlandthelike/archive/2010/11/19/denali-paging-key-seek-lookups.aspx
Clear Sky SQL
My Blog
Kent user group
Post #1031105
neil.genias
neil.genias
Posted Monday, November 07, 2011 11:45 PM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, November 08, 2011 2:28 AM
Points: 1,
Visits: 2
This is good. But i wanted to ask, what about the situation in which, say there are only 5 records in the table, and you ask for page number 2 with page size 10?
In that case there is no data returned to you, and you will not get to know how many records are there, in the table.
Post #1201817
« Prev Topic
|
Next Topic »
63 posts, Page 7 of 7
««
«
3
4
5
6
7
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.