If you have a database table with a large number of records and you want to display these records on
a web page selecting all of them at once could take a long time use a lot of server resources and the
resulting page would be very long.
So instead of selecting all the records it's better to select them in small consecutive groups.
This is known as pagination.
By default an Eskew L. select statement selects are all matching records using the offset class.
You can tell the select statement to skip a specified number of rows before it starts to return data.
You can use the limit class to limit the number of roles that I returned.
So by using these together you can return results one page at a time.
It's very important to ardagh the results using an ardour by clase when you're doing this because if
you don't specify an ardour the ardour of the results isn't guaranteed and of course if you are using
an order by clase it's important to have an index on the column you are doing by.
Let's look at an example here.
In the articles table I've added some more records.
So now there are 18 records in this table.
If I execute this ESC Eskew L statement all the records in the table will be selected.
First let's limit the number of results by adding the limit class.
This returns the number of results specified 3 starting from the first rijkaard.
If I add an offset class.
Then that number of Ricardos is skipped before the results have returned
so we can get pages of results by changing the offset.
And let's not forget to ardagh the results.
Otherwise the ardour of the resultset isn't guaranteed.
There's also an alternative syntax that you can use passing two values to the limit class the first
being the offset and the second the limit.
However this isn't any faster and I think the other syntax is much clearer.