Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: COMPOSITE INDEX does not work #4046

Open
2 tasks done
ioannist opened this issue May 15, 2024 · 0 comments
Open
2 tasks done

Bug: COMPOSITE INDEX does not work #4046

ioannist opened this issue May 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working topic:indexing This is related to indexing and full-text search triage This issue is new

Comments

@ioannist
Copy link

ioannist commented May 15, 2024

Describe the bug

REMOVE TABLE haircut;

UPDATE haricut:1 CONTENT {
    year: 2022,
};

DEFINE INDEX timeIndex ON TABLE haircut COLUMNS year;

SELECT * FROM haircut WHERE year = 2022 EXPLAIN; // uses index as expected

//----------

REMOVE TABLE haircut;

UPDATE haricut:1 CONTENT {
    year: 2022,
    month: 5,
};

DEFINE INDEX timeIndex ON TABLE haircut COLUMNS year, month;

SELECT * FROM haircut WHERE year = 2022 AND month = 5 EXPLAIN; // does not use composite index as expected

Steps to reproduce

Execute code above

Expected behaviour

A composite index should be used just like a one-value index.

SurrealDB version

1.5

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ioannist ioannist added bug Something isn't working triage This issue is new labels May 15, 2024
@kearfy kearfy added the topic:indexing This is related to indexing and full-text search label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic:indexing This is related to indexing and full-text search triage This issue is new
Projects
None yet
Development

No branches or pull requests

3 participants