Where to order a result set randomly - in database or in memory?
问题 Data source will contain approx. 5000 records. I know that it is possible to order data randomly with orderby newid() . But data to be sorted should be paged. That means page n can not contain records from previous pages (n-1, n-2 etc). Now I think I have 2 ways to go: ordering in database, or in memory (because 5000 records is small enough to hold it in in-memory cache). For option 1 (sorting in db) I am not sure if it's possible because data should be paged. Is it possible if yes how? For