Re: Why OPTIMIZE_REUSE_RESULT is set to 0 explicitly in o.a.i.i.p.query.h2.ConnectionManager#DEFAULT_DB_OPTIONS

2020-04-29 Thread Konstantin Orlov
Ivan, Nikolay, guys Sorry if I didn’t put it very clearly. The only caveat I would like to emphasize is that we must invalidate the results. H2 does this by comparing table's maxDataModificationId with the databases' current modificationDataId. We have a H2StatementCache, where Query object

Re: Why OPTIMIZE_REUSE_RESULT is set to 0 explicitly in o.a.i.i.p.query.h2.ConnectionManager#DEFAULT_DB_OPTIONS

2020-04-27 Thread Nikolay Izhikov
Hello, Konstantin. > I think we cannot just turn this optimization on Why is that? If we turn on `OPTIMIZE_REUSE_RESULT` consequences would be the following: * concurrent updated of the subquery table will not be used(we have no guarantee on that, for now) * performance of the select increase

Re: Why OPTIMIZE_REUSE_RESULT is set to 0 explicitly in o.a.i.i.p.query.h2.ConnectionManager#DEFAULT_DB_OPTIONS

2020-04-22 Thread Ivan Daschinsky
Thank you for your response, Konstantin I think we cannot just turn this optimization > Of course not, that is the reason why I started this thread. org.apache.ignite.internal.processors.query.h2.opt.GridH2Table don't change > it neither on remove or update Yes, but we can increment this

Re: Why OPTIMIZE_REUSE_RESULT is set to 0 explicitly in o.a.i.i.p.query.h2.ConnectionManager#DEFAULT_DB_OPTIONS

2020-04-22 Thread Konstantin Orlov
Hello, Ivan I think we cannot just turn this optimization on because a result invalidation counts on org.h2.engine.Database#modificationDataId (see org.h2.command.dml.Query#sameResultAsLast(Session, Value[], Value[], long)), but org.apache.ignite.internal.processors.query.h2.opt.GridH2Table

Why OPTIMIZE_REUSE_RESULT is set to 0 explicitly in o.a.i.i.p.query.h2.ConnectionManager#DEFAULT_DB_OPTIONS

2020-04-21 Thread Ivan Daschinskiy
Hello folks. Recently I trying to investigate why when the query, i.e. «SELECT * FROM T1 WHERE ID IN (SELECT T1_ID FROM T2), is executed locally, subquery evaluated, even if result is the same. I noticed, that in mentioned in subj (.ConnectionManager#DEFAULT_DB_OPTIONS), parameter