LokiDB icon indicating copy to clipboard operation
LokiDB copied to clipboard

What's the best index for $eq only, or perhaps JOINing collections?

Open patarapolw opened this issue 5 years ago • 1 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/LokiJS-Forge/LokiDB/blob/master/CONTRIBUTING.md#question

Current behavior

Currently, I am using RangedIndex for everything, even if I will never perform > or <.

    zhToken = zh.addCollection('token', {
      unique: ['entry'],
      rangedIndexes: {
        sub: { indexTypeName: 'avl', comparatorName: 'js' },
        sup: { indexTypeName: 'avl', comparatorName: 'js' },
        variants: { indexTypeName: 'avl', comparatorName: 'js' },
        tag: { indexTypeName: 'avl', comparatorName: 'js' }
      }
    })

Where sub, sup, variants, tag are all string[], and not supported to be sorted upon.

Expected behavior

Maybe, a faster index is needed, depending on use case. Not everything is avl/js.

Environment


LokiDB version: 2.1.0
Browser/Node version: Node 12.19.0

patarapolw avatar Nov 25 '20 03:11 patarapolw

I'm curious about this as well.

greaterking avatar Jan 05 '21 22:01 greaterking