2 ms·
> And if you need to support older databases (prior to SQL Server 2005), it gets worse: [some bad SQL] If you're stuck using a database version that first came
by koolba 10y ago
> And if you need to support older databases (prior to SQL Server 2005), it gets worse: [some bad SQL]
If you're stuck using a database version that first came out a decade ago, you've got bigger problems than legacy syntax for pagination.
> Not only is this complicated and messy, but it violates the DRY principle (Don't Repeat Yourself). Here's same query in LINQ. The gain in simplicity is clear: var thirdPage = query.Skip(20).Take(10);
If you're using OFFSET / LIMIT to do paging then you're doing it wrong. See here for the real way to handle paging for large result sets: http://use-the-index-luke.com/blog/2013-07/pagination-done-the-postgresql-way http://use-the-index-luke.com/blog/2013-07/pagination-done-t...
- pg_is_a_butt 10y agoIf you're using OFFSET / LIMIT to do paging then you might be doing it right. If you're not using OFFSET / LIMIT to do paging then you might be doing it wrong. you're all idiots.
- starik36 10y agoSometimes you have no choice. Like when an employer looks at the license cost of going from SQL Server 2005 to 2016 and figures that if it isn't broken, why fix it.
- pmontra 10y agoGreat link, thanks. Is PostgreSQL still the only db supporting that?
- MarkusWinand 10y agoThe right charts on slide 45 says "X" for SQLite. That changed recently: https://www.sqlite.org/releaselog/3_15_0.html https://www.sqlite.org/releaselog/3_15_0.html DB2 LUW has also decent row-values support: http://use-the-index-luke.com/blog/2014-11/seven-surprising-findings-about-DB2#blog-db2intro-rowvalues http://use-the-index-luke.com/blog/2014-11/seven-surprising-... Need to update the slides...