Skip to content

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

Description

@patarapolw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions