You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "michael.griggs" <mi...@gridgain.com> on 2017/03/15 18:07:03 UTC
Timeout on a SQL query issues another SQL query to generate EXPLAIN
In IgniteH2Indexing.java#executeSqlQueryWithTimer we automatically issue a
second query to "EXPLAIN" why a query has timed out. I think we should make
optional the automatic issuance of a second "EXPLAIN" query. When a query
times out it could very well be due to high load on the system, and issuing
a second query for every timed-out one will only increase system load,
leading to more timeouts, and so on...
ResultSet rs = executeSqlQuery(conn, stmt, timeoutMillis,
cancel); long time = U.currentTimeMillis() - start;
long longQryExecTimeout =
schemas.get(schema(space)).ccfg.getLongQueryWarningTimeout(); if
(time > longQryExecTimeout) { String msg = "Query execution
is too long (" + time + " ms): " + sql; ResultSet plan =
executeSqlQuery(conn, preparedStatementWithParams(conn, "EXPLAIN " + sql,
params, false), 0, null);
What do others think?
--
View this message in context: http://apache-ignite-developers.2346864.n4.nabble.com/Timeout-on-a-SQL-query-issues-another-SQL-query-to-generate-EXPLAIN-tp15475.html
Sent from the Apache Ignite Developers mailing list archive at Nabble.com.
Re: Timeout on a SQL query issues another SQL query to generate EXPLAIN
Posted by Sergi Vladykin <se...@gmail.com>.
Explain is relatively fast operation, it is just parsing + prepare, not the
query execution. If one does not like to see these warnings, he can
increase longQueryWarningTimeout property on the configuration, so it is
already optional and I don't see any problems here.
Sergi
2017-03-15 22:26 GMT+03:00 Dmitriy Setrakyan <ds...@apache.org>:
> Perhaps we can cache the timed out queries, so we don't need to "explain"
> them more than once.
>
> On Wed, Mar 15, 2017 at 11:07 AM, michael.griggs <
> michael.griggs@gridgain.com> wrote:
>
> > In IgniteH2Indexing.java#executeSqlQueryWithTimer we automatically
> issue a
> > second query to "EXPLAIN" why a query has timed out. I think we should
> > make
> > optional the automatic issuance of a second "EXPLAIN" query. When a
> query
> > times out it could very well be due to high load on the system, and
> issuing
> > a second query for every timed-out one will only increase system load,
> > leading to more timeouts, and so on...
> > ResultSet rs = executeSqlQuery(conn, stmt, timeoutMillis,
> > cancel); long time = U.currentTimeMillis() - start;
> > long longQryExecTimeout =
> > schemas.get(schema(space)).ccfg.getLongQueryWarningTimeout();
> > if
> > (time > longQryExecTimeout) { String msg = "Query
> execution
> > is too long (" + time + " ms): " + sql; ResultSet plan =
> > executeSqlQuery(conn, preparedStatementWithParams(conn, "EXPLAIN " +
> sql,
> > params, false), 0, null);
> > What do others think?
> >
> >
> >
> > --
> > View this message in context: http://apache-ignite-
> > developers.2346864.n4.nabble.com/Timeout-on-a-SQL-query-
> > issues-another-SQL-query-to-generate-EXPLAIN-tp15475.html
> > Sent from the Apache Ignite Developers mailing list archive at
> Nabble.com.
>
Re: Timeout on a SQL query issues another SQL query to generate EXPLAIN
Posted by Dmitriy Setrakyan <ds...@apache.org>.
Perhaps we can cache the timed out queries, so we don't need to "explain"
them more than once.
On Wed, Mar 15, 2017 at 11:07 AM, michael.griggs <
michael.griggs@gridgain.com> wrote:
> In IgniteH2Indexing.java#executeSqlQueryWithTimer we automatically issue a
> second query to "EXPLAIN" why a query has timed out. I think we should
> make
> optional the automatic issuance of a second "EXPLAIN" query. When a query
> times out it could very well be due to high load on the system, and issuing
> a second query for every timed-out one will only increase system load,
> leading to more timeouts, and so on...
> ResultSet rs = executeSqlQuery(conn, stmt, timeoutMillis,
> cancel); long time = U.currentTimeMillis() - start;
> long longQryExecTimeout =
> schemas.get(schema(space)).ccfg.getLongQueryWarningTimeout();
> if
> (time > longQryExecTimeout) { String msg = "Query execution
> is too long (" + time + " ms): " + sql; ResultSet plan =
> executeSqlQuery(conn, preparedStatementWithParams(conn, "EXPLAIN " + sql,
> params, false), 0, null);
> What do others think?
>
>
>
> --
> View this message in context: http://apache-ignite-
> developers.2346864.n4.nabble.com/Timeout-on-a-SQL-query-
> issues-another-SQL-query-to-generate-EXPLAIN-tp15475.html
> Sent from the Apache Ignite Developers mailing list archive at Nabble.com.