forked from apache/cassandra-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 39
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
While looking into performance issues in one of our clusters I've noticed that the v4.17 Java driver does uses some sub-optimal queries on connecting to the cluster:
Line 83 in d33dbc5
| new Query("SELECT cluster_name FROM system.local"); |
Line 171 in d33dbc5
| CompletionStage<AdminResult> localQuery = query(channel, "SELECT * FROM system.local"); |
Both of these queries force full table scan as there's no key reference. I've tried appending
WHERE key = 'local' to these queries and as a result the Session creation got about 90 % faster in the troubled cluster case. (YMMV)
This seems to be fixed in the 3.x version of the driver.
java-driver/driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java
Line 79 in 9fe1e03
| private static final String SELECT_LOCAL = "SELECT * FROM system.local WHERE key='local'"; |
Looks related to this issue.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers