Skip to content

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

Merged
dkropachev merged 1 commit into
scylladb:scylla-4.xfrom
mykaul:scylla-4.x
Feb 14, 2025
Merged

dkropachev merged 1 commit into
scylladb:scylla-4.xfrom
mykaul:scylla-4.x

Conversation

@mykaul

@mykaul mykaul commented Feb 13, 2025

Copy link
Copy Markdown

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
Copy Markdown

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

mykaul commented Feb 13, 2025 •

Copy link
Copy Markdown
Author

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

mykaul commented Feb 13, 2025

Copy link
Copy Markdown
Author

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

@roydahan

Copy link
Copy Markdown
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

Bouncheck commented Feb 13, 2025 •

Copy link
Copy Markdown

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

mykaul commented Feb 13, 2025

Copy link
Copy Markdown
Author

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

mykaul commented Feb 13, 2025

Copy link
Copy Markdown
Author

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
Copy Markdown

Created #435 to quickly take care of this

@dkropachev

Copy link
Copy Markdown

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
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