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

Add "WHERE key='local'" to accelerate queries against system.local #434

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

mykaul
Copy link

@mykaul mykaul commented Feb 13, 2025

Just like other drivers (Python, GoCQL), the Java 4.x driver can query with this simple WHERE clause added, to improve query performance.

Fixes: #282

Signed-off-by: Yaniv Kaul [email protected]

(Untested!)

@Lorak-mmk
Copy link

What other keys can be in this table? For a 3-node cluster I get:

SELECT key FROM system.local;

 key
-------
 local

so I don't see what this WHERE clause is changing.

@mykaul
Copy link
Author

mykaul commented Feb 13, 2025

What other keys can be in this table? For a 3-node cluster I get:

SELECT key FROM system.local;

 key
-------
 local

so I don't see what this WHERE clause is changing.

I think what it does is convert it from a full scan to a regular partition query (see #23 (comment) ).
Other drivers had it too, this is aligning with them.

@mykaul mykaul force-pushed the scylla-4.x branch 3 times, most recently from 9e53894 to 575750e Compare February 13, 2025 15:26
@mykaul
Copy link
Author

mykaul commented Feb 13, 2025

It's unclear to me why zero token tests are running against 2024.2. What's the expected results here?

@roydahan
Copy link
Collaborator

It's unclear to me why zero token tests are running against 2024.2. What's the expected results here?

I don't remember if it's in 2024.2 or not, but if not this should be changes:

public void checkScyllaVersion() {
    // minOSS = "6.2.0",
    // minEnterprise = "2024.2.3",
    // Zero-token nodes introduced in scylladb/scylladb#19684
    assumeTrue(CcmBridge.SCYLLA_ENABLEMENT);
    if (CcmBridge.SCYLLA_ENTERPRISE) {
      assumeTrue(
          CcmBridge.VERSION.compareTo(Objects.requireNonNull(Version.parse("2024.2.3"))) >= 0);

@Bouncheck
Copy link
Collaborator

Bouncheck commented Feb 13, 2025

When creating this test there was no official Scylla release with zero-token related changes in. I've set the requirement to the next numbered version I expected to appear, so I wouldn't forget to adjust this. I did not want to overshoot the version requirement.
This just needs to be updated to the higher number

@mykaul
Copy link
Author

mykaul commented Feb 13, 2025

It's unclear to me why zero token tests are running against 2024.2. What's the expected results here?

#413 is merged, but I'm still failing on it.

@mykaul
Copy link
Author

mykaul commented Feb 13, 2025

When creating this test there was no official Scylla release with zero-token related changes in. I've set the requirement to the next numbered version I expected to appear, so I wouldn't forget to adjust this. I did not want to overshoot the version requirement. This just needs to be updated to the higher number

I think it's an 2025.1.0 feature.

@Bouncheck
Copy link
Collaborator

Created #435 to quickly take care of this

@dkropachev
Copy link
Collaborator

Created #435 to quickly take care of this

@mykaul could you please rebase it

Just like other drivers (Python, GoCQL), the Java 4.x driver can query with this simple WHERE clause added, to improve
query performance.

Fixes: scylladb#282
Signed-off-by: Yaniv Kaul <[email protected]>
@dkropachev dkropachev merged commit 1e0eae9 into scylladb:scylla-4.x Feb 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suboptimal queries on Session/Connection initiation in version 4.17
5 participants