Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3438224
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:09:41+00:00 2026-05-18T08:09:41+00:00

It might be a frequently asked question, however so far i couldn’t find a

  • 0

It might be a frequently asked question, however so far i couldn’t find a convincing answer.

In my project, I need to do paging for a set of around 20,000+ records which is a joined result from multiple tables, and it need to be sorted differently in different scenarios.

Currently, there are 2 options in front of me:

1, do it by using store procedure on database tier ie. where dl.[row_number] between @index*@size+1 and @index*@size+@size.
The problem of doing it is, you will have to write Store Procs for each sorting seperately.

2, do it on Business Logic tier, and do paging and sorting above the result. (ie. skip(), take())
But it is not ideal neither, since you may end up retrieving 20,000 records, but only 10 of them is used

Is there any standard best practice available for this? thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:09:42+00:00Added an answer on May 18, 2026 at 8:09 am

    keep this logic at the database layer.

    if using the stored proc, then extend it to also include the sort column(s) so you can return the right set

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to perform this SQL very frequently UPDATE Users SET UserPoint=UserPoint+(@UserPoint) WHERE UserID=@UserID
I frequently find that I need to have a build on my iPhone which
My iPhone programs frequently contain grouped table views. A typical use might be for
Might be my question sounds more naive. But I wanted to know if it
Might be my question is abstract or out of context, but i am asking
Might be a bit of noob question but it's something that's been getting me
might be a stupid question but I seem to be confused. Im pretty new
Might be a stupid question but in our iOS app we're storing an integer
might be a silly question nonetheless: I'm playing around with the following code: $a='a';
This might seem like a very easy question for some of you folks, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.