I am getting 200000 records as a query output.
If I am calling the query by adding OFFSET and LIMIT clause.
select a.location, a.name from buckethelp a order by a.location LIMIT 20000 OFFSET 20000
I need call the query 10 times to get 200000 records.
Which one of the above 2 operations, is more heavy for the server.
When OFFSET is given, then the query will process all the records and fetch only records given in OFFSET clause,
is that correct ?
Or if OFFSET is given then the query will process only records in OFFSET clause and return them.
WHEN OFFSET, LIMIT is given query needs to process OFFSET+LIMIT records and skip OFFSET records and produce LIMIT records.
If there is ORDER it needs to process all qualified records.
Check out https://dzone.com/articles/designing-index-for-query-in-couchbase-n1ql
If you need to use OFFSET try 5.0