inside Habbie's mind

scrolling in large resultsets with SQL

written by peter, on Oct 8, 2007 7:48:00 AM.

This article on the SQLite wiki details how to efficiently maintain a small window on a big dataset without sacrificing performance, in environments that cannot maintain actual cursors, or where doing so is prohibitively expensive. Rule 2 in the article applies to other databases too; the method detailed in the article applies to any database in which keeping cursors is either impossible or expensive.

The article seems obvious; but I had not actually thought of that approach myself, so far.

Comments

  • This is why I always implement my scrolling sets myself with queries instead of using the ‘standard’ API’s in web development. Those usually use the LIMIT function in the SQL statements. Very inefficient indeed. Good article and yes, it works indeed for almost all databases.

    Comment by veenbeest — Oct 9, 2007 5:12:14 AM | # - re

Leave a Reply