Database Reference
In-Depth Information
use the natural ordering of primary keys to put a lower bound on the key values displayed
on a given page.
Let's insert a couple more rows into our table to get a sense of how pagination works us-
ing the following INSERT statements:
INSERT INTO "users"
("username", "email", "encrypted_password")
VALUES (
'carol',
'carol@gmail.com',
0xed3d8299b191b59b7008759a104c10af3db6e63a
);
INSERT INTO "users"
("username", "email", "encrypted_password")
VALUES (
'dave',
'dave@gmail.com',
0x6d1d90d92bbab0012270536f286d243729690a5b
);
Now that we've got four users in our system, we can paginate over them. To save
ourselves the trouble of adding numerous additional entries by hand, we'll just use a page
size of two to demonstrate the process. We'll start by retrieving the first page as follows:
SELECT * FROM users
LIMIT 2;
The LIMIT part of the query simply tells Cassandra to return no more than two results:
Search WWH ::




Custom Search