defradb icon indicating copy to clipboard operation
defradb copied to clipboard

[Epic] Secondary Indexes

Open jsimnz opened this issue 3 years ago • 1 comments

Currently, only Primary Indexes are implemented, which is a simple relation between dockey/field => state_data. Effectively this is an index on the dockey field of a document. This is a minimal requirement for making the DB work, however we need to let devs also manually define "Secondary Indexes".

Secondary Indexes allow devs to index on alternative fields, even a combination of multiple fields. Which can lead to effecient querys for certain filter/order/etc arguments. The idea is if a developer knows ahead of time the likely kind of queries/lookups their respective application needs, then they can optimize the DB structure for those specific queries.

Starting a spec doc as there are a number of goals/compromises/designs that need to be considered: https://hackmd.io/rLHMu-KvRFC0OoE8xkwYlA

- [x] https://github.com/sourcenetwork/defradb/issues/231
- [ ] https://github.com/sourcenetwork/defradb/issues/297
- [ ] https://github.com/sourcenetwork/defradb/issues/1553
- [ ] https://github.com/sourcenetwork/defradb/issues/1555
- [ ] https://github.com/sourcenetwork/defradb/issues/298
- [ ] https://github.com/sourcenetwork/defradb/issues/299
- [ ] https://github.com/sourcenetwork/defradb/issues/296
- [x] #307
- [ ] https://github.com/sourcenetwork/defradb/issues/1585
- [ ] https://github.com/sourcenetwork/defradb/issues/2132
- [ ] https://github.com/sourcenetwork/defradb/issues/2229
- [ ] https://github.com/sourcenetwork/defradb/issues/2180
- [ ] https://github.com/sourcenetwork/defradb/issues/2247
- [ ] https://github.com/sourcenetwork/defradb/issues/2174
- [ ] https://github.com/sourcenetwork/defradb/issues/2279
- [ ] https://github.com/sourcenetwork/defradb/issues/2280
- [ ] https://github.com/sourcenetwork/defradb/issues/2601
- [ ] https://github.com/sourcenetwork/defradb/issues/2680

jsimnz avatar Feb 09 '22 22:02 jsimnz