Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • Labels:
      None

      Description

      Some write-only queries (insert, update, delete) could be run in the background (from a client point-of-view), but MariaDB (client) currently provides no API for this. Could such an API be added?
      At first the client could spawn a worker thread and run the queries there (on a separate connection), but when protocol support becomes available a separate connection might no longer be necessary.
      An ordering flag would probably be required as queries could either be run out-of-order, in-order with other background queries or in-order with all other queries.
      The initial design could be emulated in application code, but the ideal design can not.
      I'm aware of the async client features, but this is something different.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment - - edited

            Please check out non-blocking client library – is it what you are looking for?
            (You mentioned that you are aware of the async client features, but I'm not sure what exactly you had in mind)

            Show
            elenst Elena Stepanova added a comment - - edited Please check out non-blocking client library – is it what you are looking for? (You mentioned that you are aware of the async client features, but I'm not sure what exactly you had in mind)
            Hide
            XTF Olaf van der Spek added a comment -

            No, as I wrote: "I'm aware of the async client features, but this is something different."
            Consider a PHP script. I'd like to fire (and forget) a query and continue with the script without waiting. I don't (and can't, in case of PHP) want to manually babysit MySQL connections.

            Show
            XTF Olaf van der Spek added a comment - No, as I wrote: "I'm aware of the async client features, but this is something different." Consider a PHP script. I'd like to fire (and forget) a query and continue with the script without waiting. I don't (and can't, in case of PHP) want to manually babysit MySQL connections.
            Hide
            serg Sergei Golubchik added a comment -

            This is basically INSERT DELAYED, isn't it? But also for DELETE and UPDATE. And with cleaner internal implementation (currently there are engines that do not support INSERT DELAYED — which means to me that it doesn't look like a normal connection thread, and it needs to be fixed).

            Show
            serg Sergei Golubchik added a comment - This is basically INSERT DELAYED, isn't it? But also for DELETE and UPDATE. And with cleaner internal implementation (currently there are engines that do not support INSERT DELAYED — which means to me that it doesn't look like a normal connection thread, and it needs to be fixed).
            Hide
            XTF Olaf van der Spek added a comment -

            It's INSERT DELAYED on steroids, but it shouldn't be limited to insert, delete or update, it should be even faster as you don't have to wait for the query being send and it allows for an initial but very useful client-side-only implementation.

            Show
            XTF Olaf van der Spek added a comment - It's INSERT DELAYED on steroids, but it shouldn't be limited to insert, delete or update, it should be even faster as you don't have to wait for the query being send and it allows for an initial but very useful client-side-only implementation.
            Hide
            f_razzoli Federico Razzoli added a comment - - edited

            I have a suggestion. Instead of implementing this in the client lib, it could be implemented in the server. So stored procedures could do something like:

            EXECUTE IN BACKGROUND <some_sql>;

            I hope this is possible.

            Show
            f_razzoli Federico Razzoli added a comment - - edited I have a suggestion. Instead of implementing this in the client lib, it could be implemented in the server. So stored procedures could do something like: EXECUTE IN BACKGROUND <some_sql>; I hope this is possible.
            Hide
            serg Sergei Golubchik added a comment -

            Federico Razzoli, yes, this should be easy. It's pretty much the same as an EVENT with ON COMPLETION NOT PRESERVE.

            Show
            serg Sergei Golubchik added a comment - Federico Razzoli , yes, this should be easy. It's pretty much the same as an EVENT with ON COMPLETION NOT PRESERVE.
            Hide
            f_razzoli Federico Razzoli added a comment -

            Thanks. CREATE EVENT could be an alternative too, except that it doesn't work inside stored procedures

            Show
            f_razzoli Federico Razzoli added a comment - Thanks. CREATE EVENT could be an alternative too, except that it doesn't work inside stored procedures

              People

              • Assignee:
                Unassigned
                Reporter:
                XTF Olaf van der Spek
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: