08.02.2022 16:36, Adriano dos Santos Fernandes wrote:
First what should be the statement key in the cache? I've peek these: - statement text - clientDialect - isInternalRequest - current client charset (as external engines may change it)
Cannot the UTF8-translated SQL text (which is currently inside Statement::sqlText) be the key, to avoid dependency on the charset? I don't think that semantically different statements may have the same UTF8 representation. However, it would make sense to have a single cached statement for the same statement executed from different client charsets.
- active roles
Already wrote about that.
Then there is when statements should go out of cache? I see three approaches: - 1. Timeout after its put in the cache, updated when it is get from it - 2. LRU based on memory consumption and max cache size - 3. Both 1. and 2.
I'd start with 2. How are you going to calculate the memory consumption? Size of the statement pool + impureSize?
Should it be enabled by default?
Maybe, with a reasonable size. As Mark says, it doesn't make sense to disable new features by default ;-)
Dmitry Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel