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

A partition key index may cause a regular query to fail with "No such index" #4539

Closed
psarna opened this issue Jun 11, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@psarna
Copy link
Member

commented Jun 11, 2019

This is Scylla's bug tracker, to be used for reporting bugs only.
If you have a question about Scylla, and not a bug, please ask it in
our mailing-list at scylladb-dev@googlegroups.com or in our slack channel.

  • I have read the disclaimer above, and I am reporting a suspected malfunction in Scylla.

Installation details
Scylla version (or git commit hash): master (9213d56)

The following, perfectly legal sequence of queries:

CREATE TABLE test_a(a BIGINT, b BIGINT, c BIGINT, PRIMARY KEY ((a, b)));
CREATE INDEX ON test_a(a);
INSERT INTO test_a (a, b, c) VALUES (1, 2, 3);
SELECT * FROM test_a WHERE a=1 AND b=2 AND c = 3 ALLOW FILTERING;

will cause a No index found. error, because there's a bug in the code that tries to figure out if a query is an indexed query or a regular one. I'm leaving the issue here as a placeholder, as I already pinpointed the problem, but I need some time to provide it with proper tests. Feel free to assign this issue to me.

psarna added a commit to psarna/scylla that referenced this issue Jun 11, 2019

cql3: fix deciding if a query uses indexing
[DO NOT MERGE YET]

The code that decides whether a query should used indexing
was buggy - a partition key index might have influenced the decision
even if the whole partition key was passed in the query (which
effectively means that indexing it is not necessary).

TODO: provide a test

Fixes scylladb#4539

psarna added a commit to psarna/scylla that referenced this issue Jun 12, 2019

tests: add case for partition key index and filtering
The test ensures that partition key index does not influence
filtering decisions for regular columns.

Ref scylladb#4539

psarna added a commit to psarna/scylla that referenced this issue Jun 12, 2019

tests: add case for partition key index and filtering
The test ensures that partition key index does not influence
filtering decisions for regular columns.

Ref scylladb#4539
@slivne

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

@psarna do we need to backport this to 3.0 ?

@slivne slivne added the Backport 3.1 label Jun 12, 2019

@psarna

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

@slivne yes, same for #4540 and #4541

@slivne slivne added the Backport 3.0 label Jun 12, 2019

@slivne slivne added this to the 3.2 milestone Jun 13, 2019

nyh added a commit that referenced this issue Jun 17, 2019

Fix deciding whether a query uses indexing
The code that decides whether a query should used indexing was buggy - a partition key index might have influenced the decision even if the whole partition key was passed in the query (which effectively means that indexing it is not necessary).

Fixes #4539

Closes #4544

Merged from branch 'fix_deciding_whether_a_query_uses_indexing' of git://github.com/psarna/scylla
  tests: add case for partition key index and filtering
  cql3: fix deciding if a query uses indexing

avikivity added a commit that referenced this issue Jun 18, 2019

Fix deciding whether a query uses indexing
The code that decides whether a query should used indexing was buggy - a partition key index might have influenced the decision even if the whole partition key was passed in the query (which effectively means that indexing it is not necessary).

Fixes #4539

Closes #4544

Merged from branch 'fix_deciding_whether_a_query_uses_indexing' of git://github.com/psarna/scylla
  tests: add case for partition key index and filtering
  cql3: fix deciding if a query uses indexing

(cherry picked from commit 6aab1a6)

psarna added a commit to psarna/scylla that referenced this issue Jun 18, 2019

cql3: fix deciding if a query uses indexing
The code that decides whether a query should used indexing
was buggy - a partition key index might have influenced the decision
even if the whole partition key was passed in the query (which
effectively means that indexing it is not necessary).

Fixes scylladb#4539

psarna added a commit to psarna/scylla that referenced this issue Jun 18, 2019

tests: add case for partition key index and filtering
The test ensures that partition key index does not influence
filtering decisions for regular columns.

Ref scylladb#4539

avikivity added a commit that referenced this issue Jun 18, 2019

Merge "Fix deciding whether a query uses indexing" from Piotr
"
This series backports fixing deciding whether a query uses indexing
for branch-3.0

Fixes #4539
Branches: 3.0
"

* 'fix_deciding_whether_a_query_uses_indexing_for_3.0' of https://github.com/psarna/scylla:
  tests: add case for partition key index and filtering
  cql3: fix deciding if a query uses indexing
@avikivity

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2019

Backported, removing frrom backport candidates.

glommer added a commit to glommer/scylla that referenced this issue Jun 26, 2019

Fix deciding whether a query uses indexing
The code that decides whether a query should used indexing was buggy - a partition key index might have influenced the decision even if the whole partition key was passed in the query (which effectively means that indexing it is not necessary).

Fixes scylladb#4539

Closes scylladb#4544

Merged from branch 'fix_deciding_whether_a_query_uses_indexing' of git://github.com/psarna/scylla
  tests: add case for partition key index and filtering
  cql3: fix deciding if a query uses indexing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.