joao-r-reis commented on PR #1959: URL: https://github.com/apache/cassandra-gocql-driver/pull/1959#issuecomment-4712328204
The goal of https://github.com/apache/cassandra-gocql-driver/pull/1868 was mostly to move the execution related data from `Query`/`Batch` to `Iter` so that you can, for example, call `.Iter()` on the same exact query and parameters multiple times without worrying about metrics, paging data or other similar metadata being overwritten or polluted because the v1 design required you to inspect the `Query` object post execution to access the metadata related to that execution. I think we still have some work to do to make query objects truly reusable (and safe for concurrent use) by making them immutable for example. Another goal of that PR was to just get rid of query object pooling altogether because the added complexity is just not worth it (in the rare case that a particular workload does see significant performance impact when objects aren't reused then they can add that pooling/caching on the application side). But this PR does make sense since we expect users to build their own pooling/caching if they truly want to reuse the query objects even with different parameters and currently you can do that for queries built via `Session.Query` but not `Session.Bind` as you correctly point out. Note that query objects are not safe for concurrent use so if you plan on making some kind of wrapper API then take this into consideration. -- 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]

