0

Is it possible to use the filter command with a secondary index? If I have no secondary indexes perform the query:

r.db('test').table('first').filter(r.row('col2').eq(8302))

Then create a secondary index on 'col2' and rerun the query, it takes the exact same amount of time. I know I can use 'getAll' and pass in an index and it is much faster but was hoping to have the filter command make use of it as well.

rycel
  • 51
  • 1
  • 5

1 Answers1

0

RethinkDB currently does not have a query optimizer, so filter will not use a secondary index.

There is an issue to use index by default (like in orderBy - but the same applies for filter) -- https://github.com/rethinkdb/rethinkdb/issues/2356 Feel free to chime in.

neumino
  • 4,342
  • 1
  • 18
  • 17
  • Thanks, I knew it didn't have a query optimizer but I thought there might be an explicit way to tell filter to use the index. – rycel Jul 14 '14 at 01:26