dcapwell commented on code in PR #2190:
URL: https://github.com/apache/cassandra/pull/2190#discussion_r1128437123
##########
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:
##########
@@ -168,6 +168,33 @@ public void validate(ClientState state)
statement.validate(state);
}
+ @Override
+ public Iterable<CQLStatement> getStatements()
+ {
+ return () -> {
+ Stream<CQLStatement> stream = assignments.stream().map(n ->
n.select);
+ if (returningSelect != null)
+ stream = Stream.concat(stream,
Stream.of(returningSelect.select));
+ stream = Stream.concat(stream, updates.stream());
+ return stream.iterator();
+ };
+ }
+
+ @Override
+ public ResultSet.ResultMetadata getResultMetadata()
+ {
+ if (returningSelect != null)
Review Comment:
to clarify, in the prepared case we would compute this once and reuse in the
`execute` response, but when not prepared you compute this on-demand and this
is short lived...
thinking about this more maybe we should, so in the prepared case we only
call `org.apache.cassandra.cql3.ResultSet#computeResultMetadataId` once and the
non-prepared case we also only call once... right now prepared case will call
this the same amount as non-prepared and an additional one while prepare...
given that `org.apache.cassandra.cql3.ResultSet#computeResultMetadataId` does
have a noticeable impact on perf, doing once would help the prepared case and
be equal to the non-prepared case... ill make this change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]