Skip to content

Interrupt query? #422

Closed
Closed

Description

@zwrmueller

Hello,

is there any way to Interrupt a (far too) long running query. Actually I kill the process, but that's not the nice way to do.

Regards
Ralf

Activity

  1. justinclift commented on Oct 2, 2015

    @justinclift
    Member

    Good question. I don't think there's a way yet, but it would make sense to add one. 😄

  2. MKleusberg commented on Oct 5, 2015

    @MKleusberg
    Member

    No, there is no way to interrupt a query. And unfortunately it's not that easy to fix because of the way SQLite works. As far as I can see we'd have to put the query execution into a separate thread which we can kill from the UI thread at any time - but this requires too much code restructuring to have it happen soon. I'm also not sure if this can somehow cause data loss in the database, so I'm not sure if it's wise to add an easy option which might encourage users to cause unwanted damages.

    So in short, I'm not sure on this. But let's keep the issue open as a reminder and maybe come back to it later 😃

  3. zwrmueller commented on Oct 6, 2015

    @zwrmueller
    Author

    Hello Martin,
    I understand your concerns. Perhaps just as information: SQLite Studio shows up an interrupt button when a query is engaged, works fine, so far no problems, but not heavily used anyway.

    I came to this, because by un(for)seen changes at my collected measurement data I run into troubles with my (old) queries: SQLite Studio could interrupt them, SQLite Browser I had to kill each time ...

    Personally I much more like SQLite Browser; I use SQLite Studio for some work because here I can attach a bunch of databases by a set of query statements, which SQLite Browser cannot.

    Regards
    Ralf

  4. mglatz commented on Oct 6, 2017

    @mglatz

    please add this :) Not an SQL expert but it should be fairly safe to execute query as a transaction in separate thread and revert the transaction on thread interruption...?

  5. MKleusberg commented on Oct 18, 2018

    @MKleusberg
    Member

    @zwrmueller @mglatz 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. 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:

  6. self-assigned this
    on Oct 18, 2018
  7. mglatz commented on Oct 18, 2018

    @mglatz

    I was really hoping to see this in the alpha released recently. It seems to work quite well.

    however switching to other tab while query is executing (eg the pragmas tab) displays the "query is runnging" message and there the app seems to freeze

  8. mglatz commented on Oct 18, 2018

    @mglatz

    I did some more testing and its not as flawless as i thoguht

    • Db browser still freezes on queries with large (15M records) tables. It seems that cancelling the query within first few seconds works but once it runs for 10 or more seconds, it cannot be cancelled anymore
    • running select stement un-greys (enables) the write and revert changes buttons (it should not do that)
    • calcelling the query leaves the result window in random states. Once I see some "loading" records, other time there are some values and some "loading" etc. Once the query is cancelled the results should be cleared.
  9. justinclift commented on Oct 18, 2018

    @justinclift
    Member

    Thanks for checking @mglatz, that's definitely weirdness that needs fixing. 😉

  10. robert-dodier commented on Jan 23, 2019

    @robert-dodier

    For what it's worth, I'd also like to see an interrupt feature.

  11. sky5walk commented on Jan 23, 2019

    @sky5walk

    Confused why the existing SQLite interrupt api, "void sqlite3_interrupt(sqlite3*);" means "a lot of code changes"?

    It is safe to call this routine from a thread different from the thread that is currently running the database operation.

  12. chrisjlocke commented on Jan 23, 2019

    @chrisjlocke
    Member

    Confused why the existing SQLite interrupt api, "void sqlite3_interrupt(sqlite3*);" means "a lot of code changes"?

    Think of DB4S as a car. SQLite is the engine. The engine has a sensor that tells you whether its running or not, and even how many revs its doing. You devise a convoluted system (no offense...) to take that sensor's output and display it to the user in some rev counter using LEDs. Pretty. Works OK. But someone else now wants it connected to a rotary dial display. "Its only a sensor. Should be easy". However, all the plumbing, design and wiring is geared towards getting the output of that sensor to power LEDs. Its going to have be ripped out and redesigned to work for an analogue needle, rather than digital LEDs.
    Or something.

    Basically, the code in DB4S isn't geared up that way, and to make it so, would require a lot of code changes. We're exceeding 300 issues as it is, with a finite list of programmers. Its a lot of work. If we had teams of programmers on standby bored waiting for input, then it could be done....

  13. sky5walk commented on Jan 23, 2019

    @sky5walk

    I mean no disrespect, as I use DB4S sometimes daily. 😄
    The car analogy is fine. The interrupt api = turning off the ignition. The car's systems are presented with no power and must act accordingly.
    It is already mentioned that users(and me 👿) have to use TaskMgr to kill hung DB4S processes.
    Can that be any worse than DB4S attempting a sqlite3_interrupt() from a single gui button?

  14. justinclift commented on Jan 23, 2019

    @justinclift
    Member

    Can that be any worse than DB4S attempting a sqlite3_interrupt() from a single gui button?

    That sums things up pretty well. 😄

  15. MKleusberg commented on Feb 10, 2023

    @MKleusberg
    Member

    Closing this issue as it looks like it has been fixed a while ago and we didn't hear anything since then. Feel free to reopen this issue if the problem still occurs.

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