On 10/02/2022 13:21, Dimitry Sibiryakov wrote: > Dmitry Yemanov wrote 10.02.2022 17:13: >> 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. > > Only if such translation is made right. Remember charset introducers. > But apparently to transform the query before using it as a cache key > is a right idea. Two queries different only by some whitespaces, > comments or case (unless in literals) should not miss the cache. >
I think the main cache objective is not to lose time processing text and caching these cases, like ad hoc different queries may have. Only basic left/right trim would be more than enough. Applications uses queries and they do not create extra random spaces in statement text everytime they prepare/execute a query. Applications also tends to use the same character set. But main problem is because messages (both DSQL and JRD) are completely different when different charsets are used. Adriano Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel