You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now (075ad41), when executing a statement - no matter if prepared or unprepared - we always request full result metadata to be returned in response. This metadata contains information about the type of each column returned in response, and we use it to decode rows from the response.
However, for prepared statements, this information is not necessary - the same metadata can be returned by the DB when the statement is being prepared and can be cached by the driver. When executing prepared statements, we can request the metadata to be omitted in response and use the cached metadata instead, which will save some bandwith.
Requesting the full metadata on every SELECT could cause significant overhead.
Recently a user reported that on the same workload Rust driver uses 60MiB/s of network bandwidth while the C++ driver uses only 23MiB/s. (https://scylladb-users.slack.com/archives/C01D7LCL44D/p1695956648707279)
I suspect that this could be caused by us not using the skip_metadata flag, for a SELECT with only a few int values sending the metadata could easily double the used bandwidth.
As of now (075ad41), when executing a statement - no matter if prepared or unprepared - we always request full result metadata to be returned in response. This metadata contains information about the type of each column returned in response, and we use it to decode rows from the response.
However, for prepared statements, this information is not necessary - the same metadata can be returned by the DB when the statement is being prepared and can be cached by the driver. When executing prepared statements, we can request the metadata to be omitted in response and use the cached metadata instead, which will save some bandwith.
There is at least one problem this approach is known to have, so we should discuss how to handle it: https://docs.datastax.com/en/developer/java-driver/3.0/manual/statements/prepared/#avoid-preparing-select-queries
The text was updated successfully, but these errors were encountered: