Tracing all SQL Queries

classic Classic list List threaded Threaded
4 messages Options
Dave Harvey Dave Harvey
Reply | Threaded
Open this post in threaded view
|

Tracing all SQL Queries

Is there a simple way inside Ignite to get a log of all SQL Queries against
the cluster, either in the debug logs or elsewhere ?    This is not a easy
question to phase in a way that Google will find a useful answer.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
slava.koptilin slava.koptilin
Reply | Threaded
Open this post in threaded view
|

Re: Tracing all SQL Queries

Hello Dave,

I am afraid that there is no such possibility out of the box.
The simple workaround that I can imagine is using IgniteConfiguration#setLongQueryWarningTimeout() method and set 1ms for example.
In that case, every SQL request that spends more than 1ms will be printed in the log as follows:
[2018-01-04 06:32:38,230][WARN ] [IgniteH2Indexing] Query execution is too long [time=3518 ms, sql='the execution plan of your SQL query will be printed here"

I think you can modify the code of IgniteH2Indexing#executeSqlQueryWithTimer for debugging purposes, and print out an execution plan always.

Thanks,
S.


чт, 12 июл. 2018 г. в 16:07, Dave Harvey <[hidden email]>:
Is there a simple way inside Ignite to get a log of all SQL Queries against
the cluster, either in the debug logs or elsewhere ?    This is not a easy
question to phase in a way that Google will find a useful answer.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ApacheUser ApacheUser
Reply | Threaded
Open this post in threaded view
|

Re: Tracing all SQL Queries

Hi Slava,
Sorry to get into this thread,I have similar problem to control long running
SQLs. I want timeout SQLs running more than 500ms.
I sthere any way to set etLongQueryWarningTimeout()  in CONFIG File?

Appreciate your response.

Thanks



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
slava.koptilin slava.koptilin
Reply | Threaded
Open this post in threaded view
|

Re: Tracing all SQL Queries

Hi,

Yes, it can be specified in your Spring configuration file as follows:
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="longQueryWarningTimeout" value="500"/> ... </bean>
Thanks,
Slava.


пн, 16 июл. 2018 г. в 19:39, ApacheUser <[hidden email]>:
Hi Slava,
Sorry to get into this thread,I have similar problem to control long running
SQLs. I want timeout SQLs running more than 500ms.
I sthere any way to set etLongQueryWarningTimeout()  in CONFIG File?

Appreciate your response.

Thanks



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/