Quantcast

Catching run-away queries

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Catching run-away queries

Chris Locke-3
If sqlite is given a slightly misconfigured SQL statement (eg, incorrect
JOIN statements), it could potentially try and retrieve millions of rows.
(Question taken from here:
https://github.com/sqlitebrowser/sqlitebrowser/issues/1005)

Is there any way of hooking into this before the actual records are
retrieved, or a way of (cleanly) terminating a query after a period of time?


Thanks,
Chris
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Catching run-away queries

Richard Hipp-3
On 5/4/17, Chris Locke <[hidden email]> wrote:
> If sqlite is given a slightly misconfigured SQL statement (eg, incorrect
> JOIN statements), it could potentially try and retrieve millions of rows.
> (Question taken from here:
> https://github.com/sqlitebrowser/sqlitebrowser/issues/1005)
>
> Is there any way of hooking into this before the actual records are
> retrieved, or a way of (cleanly) terminating a query after a period of time?

Can you get the application to use the sqlite3_interrupt()
(https://www.sqlite.org/c3ref/interrupt.html) interface to stop the
long-running query?

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Catching run-away queries

Olivier Mascia
In reply to this post by Chris Locke-3
> Le 4 mai 2017 à 17:49, Chris Locke <[hidden email]> a écrit :
>
> If sqlite is given a slightly misconfigured SQL statement (eg, incorrect
> JOIN statements), it could potentially try and retrieve millions of rows.
> (Question taken from here:
> https://github.com/sqlitebrowser/sqlitebrowser/issues/1005)
>
> Is there any way of hooking into this before the actual records are
> retrieved, or a way of (cleanly) terminating a query after a period of time?

http://sqlite.org/c3ref/interrupt.html <http://sqlite.org/c3ref/interrupt.html>

--
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia, http://integral.software

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Catching run-away queries

Chris Locke-3
In reply to this post by Richard Hipp-3
Excellent, thanks - I'll pass that on.
Very much appreciated.


Thanks,
Chris

On Thu, May 4, 2017 at 4:52 PM, Richard Hipp <[hidden email]> wrote:

> On 5/4/17, Chris Locke <[hidden email]> wrote:
> > If sqlite is given a slightly misconfigured SQL statement (eg, incorrect
> > JOIN statements), it could potentially try and retrieve millions of rows.
> > (Question taken from here:
> > https://github.com/sqlitebrowser/sqlitebrowser/issues/1005)
> >
> > Is there any way of hooking into this before the actual records are
> > retrieved, or a way of (cleanly) terminating a query after a period of
> time?
>
> Can you get the application to use the sqlite3_interrupt()
> (https://www.sqlite.org/c3ref/interrupt.html) interface to stop the
> long-running query?
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...