Page 1 of 1

Query queues and connection clusters

PostPosted: Tue Aug 27, 2013 12:20 pm
by amosmoss

Here's an idea that I'm sure will have many uses. It's pretty wild, but I thought that raising the subject may end up with some really useful features.

Lets start with a current version scenario.
When you have a query running currently on a session, and you try to run another one at the same time, you get an error that says you can't run a query when there's an active one that hasn't finished yet. So here is my proposal:

Every connection/sql editor will have a queue of queries to run, so if a query is currently active, and you execute another one, it will just be queued and ran when the last one has ended. Each time a queued query is finished, you'll get a new resultset tab.

Now, you can also have the following enhancements:
- Name the tabs by using some kind of comment standard (for example: the first word of the comment just before the statement being executed)
- Direct the query outputs to files (named and timed)
- Access the resultset or open output files directly from the QueryManager (double clicking the record)
- You can run the SQLs on a connection cluster (a new virtual connection type) which is composed of several connections. Then, a queued query will run on the first available connection in the cluster.

You can think of it as an extension for the run script command and the execute in a new tab command, combined.

This will assist doing the following tasks:
1. Run a large set of SQLs (table updates, for example) on more than one connection.
2. Run a very long script, that uses temp intermediate tables, during which performs several select queries (so I can ran it overnight). This for example can be very useful for the debugging of such scripts.
3. If for some reason one of the connections in a cluster had disconnected, the queries will be able to run on the remaining cluster's connections.

So, what do you say? I know it's probably a very big change in the architecture, but I think this new way of thinking of connections and queries will allow the user to get much more from the DBeaver.

BTW, some of these enhancements can be released by themselves (naming, accessing resultsets from the query manager, connection clusters).