i want to list records where id=1 between two timestamps and finally order them according to timestamp.
Mysql query something:
Select * from test
where (timestamp between 100099323 AND 1423699323) AND id=1
order by timestamp
there are more than 5 million documents in rethink database.
I tried using index for the simple mysql query:
Select * from test where id=1 order by timestamp
and Rethinkdb query is:
r.table('test').getAll(1, {index: 'id'}).orderBy({index: 'timestamp'})
but i am getting error:
RqlRuntimeError: Indexed order_by can only be performed on a TABLE or
TABLE_SLICE in:
r.table("test").getAll(1, {index: "id"}).orderBy({index: "timestamp"})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Any suggestion?