[
https://issues.apache.org/jira/browse/IGNITE-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16102093#comment-16102093
]
Alexander Paschenko commented on IGNITE-5382:
---------------------------------------------
[~skalashnikov]
my comments:
- please see my changes (removed weak map, made {{H2ConnectionWrapper}}
immutable)
- refactor duplicate code in {{IgniteH2Indexing}} (added a TODO on this)
- add javadocs to {{H2ConnectionCache}}
- please refactor {{IgniteH2Indexing}} to bind statements cache and its
corresponding connection together in the thread scope. Currently we drop all
thread's cached statements when we change a schema and I don't think it's
right. I believe we better store thread local maps of following structure
schema name -> [connection; statement cache] and clean them up by timeout like
it's done now for statement caches.
> SQL: frequent switch between schemas cause severe slowdown
> ----------------------------------------------------------
>
> Key: IGNITE-5382
> URL: https://issues.apache.org/jira/browse/IGNITE-5382
> Project: Ignite
> Issue Type: Task
> Components: cache, sql
> Reporter: Vladimir Ozerov
> Assignee: Sergey Kalashnikov
> Labels: important, performance
> Fix For: 2.2
>
>
> We have thread-bound cached connection to H2 database which is bound to
> specific schema. See {{IgniteH2Indexing.connectionForThread}}.
> When query with different schema is executed, we call {{SET SCHEMA}} command,
> which is rather expensive and may cause slowdown when queries form different
> caches are executed.
> To avoid this we should maintain thread-local map of such connections. Be
> careful with concurrency and resource leaks.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)