I have documents with date property, and i need to query those by date range. the date is in the doc id, as well as in a property
date. I have figured out two options:
USE KEYS ["audience:aud1:2016-01-01", "audience:aud1:2016-01-02", "audience:aud1:2016-01-03", "audience:aud1:2016-01-04"]
WHERE date BETWEEN '2016-01-01' AND '2016-01-03'
I tend to believe that option #1 is more efficient, because it uses the primary key index. of course I can create a secondary index on the field
date but it would consume its resources.
However, in option #1 I must pass all dates in the range. if its a range of 30 dates, it means 30 values… instead of just begin/end date with
Is there a way to benefit both worlds, and generate the
USE KEYS clause dynamically, given begin/end dates of my range?