2 ms·
Question on the efficiency of inverted indices for Cockroach json tables - if you do a query for identity on two of the fields, like searching for all json docu
by lacker 9y ago
Question on the efficiency of inverted indices for Cockroach json tables - if you do a query for identity on two of the fields, like searching for all json documents containing `{a: 1, b: 2}`, how efficient is that? Will it essentially only use one of the indices on a and b, or will it work like a sql multi column btree index?
- foldU 9y agoGood question! In 2.0 we only use one of the fields for the index lookup and then use the rest as a filter. For 2.1 we’re planning on augmenting our execution engine to enable making use of all the fields in a more efficient way. We have an RFC[0] describing the way our inverted indexes are designed, though not everything outlined in that document is implemented yet. [0]: https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20171020_inverted_indexes.md https://github.com/cockroachdb/cockroach/blob/master/docs/RF...