Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit number of records in aerospike select query

I am trying to query using aql (Aerospike Query Language) in aerospike set.
Suppose there are 1000 records and I want to read any 10 records. Usually I would query something like :

select * from test.demo limit 10;

How do I query the same using aql ?

like image 486
holmes840 Avatar asked Sep 19 '14 06:09

holmes840


1 Answers

At the moment you cannot do that in aql, but you can use the BETWEEN predicate to define a range to the query.

When you use the C-client (or one of the language clients that wrap around it) a scan (as_scan_foreach) can be limited by setting the percentage field of the as_scan struct.

like image 160
Ronen Botzer Avatar answered Oct 13 '22 22:10

Ronen Botzer