Skip to content

rum_anyarray_addon_ops index not working #104

@everimbaq

Description

@everimbaq

Or replace my question to "how to use rum index with rum_anyarray_addon_ops index?"

I have a table 'test_array', i want to index text array elements and order by another column. I created SQL as follows:

CREATE TABLE test_array (i text[],, score int8);

INSERT INTO test_array VALUES ('{}', 1), ('{0}',2), ('{1,2,3,4}',3), ('{1,2,3}',4), ('{1,2}',5),('{1}',6);

CREATE INDEX idx_array3 ON test_array USING rum (i rum_anyarray_addon_ops, score) with (attach='score', to='i');

explain  select * from test_array where i && '{1,2}' order by score offset 1 limit 5;

When i have few data, the query plan is like this :
image

But after inserted with 1 million data, the query plan is like this:
image

The costs has no difference with gin index sorting, and they both have "Bitmap Heap Scan" ,it seams that the index not working or not properly used ?

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