mercredi 17 juin 2015

Pagination in sqlite impossible?

One of the uses of LIMIT and OFFSET is to reduce resource usage.

But there has to be some info somewhere about how many pages there are, and some sort of navigation between pages.

But to calculate the total number of pages I need to get all the data first! So I need to make the same query twice. One with SELECT * ... LIMIT and another one with SELECT COUNT()... (without limit).

This uses twice as much resources. Is this the only way? Am I missing something here?

Aucun commentaire:

Enregistrer un commentaire