Skip to content

Any plan to support wildcard index like MongoDB #451

@xqzhou

Description

@xqzhou

Proposal

For the following example documents:

{
  "product": "iPhone",
  "attributes": {
    "storage": 16,
    "camera": 1200
  }
},
{
  "product": "Jacket",
  "attributes": {
    "size": "XL",
    "color": "Black"
  }
}

It would be convenient to create an wildcard index like:

CREATE INDEX on idx_prod_attrs on product (attribuites.$) 

Query can then filter by any of the possible attribute keys and speed up by index:

SELECT * FROM product where attributes.storage >= 16;
SELECT * FROM product where attributes.size = 'XL';

Motivation

MongoDB support this type of index
https://www.mongodb.com/blog/post/coming-in-mongodb-42--1-wildcard-indexes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions