Skip to content

Catching run-away queries #1005

Closed
Closed

Description

@justinclift

In email conversation with @h4yn0nnym0u5e, one somewhat frustrating thing that can crop up when using DB4S (manually, in the "Execute SQL" tab) is getting a join wrong, and the result set tries to return a huge number of rows. eg 1.6 mill rows

@MKleusberg @innermous @prutz1311 Any idea if there is some way we could catch that kind of thing - without needing a large amount of code change - and not let it go out of control?

Activity

  1. chrisjlocke commented on May 4, 2017

    @chrisjlocke
    Member

    Just a thought, but might be worth throwing that out to the sqlite users mailing group, as they might suggest some hook you could use .... you're not going to know how many rows you're going to get back until sqlite has done its biz (and consumed 97 GB of memory...) but you might be able to abort it after ... say, 20 seconds?

  2. justinclift commented on May 4, 2017

    @justinclift
    MemberAuthor

    Ahhh, good thinking Chris. You're already on that mailing list aren't you?

    If so, would you be ok to ask? 😄

  3. chrisjlocke commented on May 4, 2017

    @chrisjlocke
    Member

    Surely can. ✍️

  4. MKleusberg commented on May 4, 2017

    @MKleusberg
    Member

    No need to ask them 😉 This does what we need. I'd suggest to not do anything automatically because some queries just take their time. See #409 for example. But what we can do is add a cancel button which just allows the user to stop the query at any time.

  5. justinclift commented on May 4, 2017

    @justinclift
    MemberAuthor

    Awesome. 😀

  6. chrisjlocke commented on May 4, 2017

    @chrisjlocke
    Member

    Yup, Dr. Richard Hipp just replied back with the same suggestion:

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

  7. justinclift commented on May 4, 2017

    @justinclift
    MemberAuthor

    Excellent, thanks Chris & D. Richard Hipp. 😄

  8. justinclift commented on May 4, 2017

    @justinclift
    MemberAuthor
  9. mglatz commented on Jun 29, 2017

    @mglatz

    Cancel button is probably best, other possible approach I can think of is have a setting for query timeout and once that expires, ask user if he wants the query to run some more or cancel.

  10. mgrojo commented on Jan 7, 2018

    @mgrojo
    Member

    What's the state of this issue?

  11. tilusnet commented on Jul 25, 2018

    @tilusnet

    I think a cancel button is badly needed. Would it be difficult to add?

  12. MKleusberg commented on Oct 18, 2018

    @MKleusberg
    Member

    @h4yn0nnym0u5e @tilusnet Sorry for the long delay here. Are you still interested in this issue? I'm asking because we are currently preparing some changes which add, besides making some other changes, a cancel button to the Execute SQL area. Because it's changing a lot of our code we want to test this as good as we can. Are you interested in giving it a try? You can find the Windows and OSX build here:

  13. tilusnet commented on Oct 18, 2018

    @tilusnet

    Hi @MKleusberg Personally, my focus shifted away from SQLiteBrowser in the near past, moreover I am exclusively on Linux currently which makes testing impossible. Sorry I can't help.

  14. MKleusberg commented on Oct 18, 2018

    @MKleusberg
    Member

    No worries, @tilusnet 😄

  15. justinclift commented on Oct 18, 2018

    @justinclift
    MemberAuthor

    I am exclusively on Linux currently

    As a data point, we definitely compile and run ok on Linux too. My main desktop these days is CentOS 7, and that runs DB4S without issue. 😄

  16. chrisjlocke commented on Oct 18, 2018

    @chrisjlocke
    Member

    and that runs DB4S without issue.

    No it doesn't. There's 281 of them. 😉

  17. justinclift commented on Oct 18, 2018

    @justinclift
    MemberAuthor

    😛

  18. MKleusberg commented on Feb 12, 2020

    @MKleusberg
    Member

    Let's close this issue. I'm pretty sure the cancel button is working as expected and we have other open issues for this too 😄

    and that runs DB4S without issue.

    No it doesn't. There's 281 of them. 😉

    I wish this was still the case 😉

  19. self-assigned this
    on Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions