Mark Atwood (fallenpegasus) wrote,
Mark Atwood

Query Logging on Drizzle

A project I have been working on for a while just hit a significant milestone.

Pluggable Query Logging has just been merged into the main Drizzle development.

The plan is that quickly this will replace the existing query log and slow query log that Drizzle inherited from MySQL.

The legacy logging system is more than a bit byzantine, is full of a lot of complexity to try to get incremental performance with complicated buffering, and yet has several completely unnecessary locks.

In the new plugin logging system, there is a callback right after a query is parsed but before it is executed, and another one right after it is done executing. A plugin registers itself, and will be called at those two points, and is passed the THD, from which it can learn everything about the query that will be / has been executed, and then do whatever it wants with that information.

Of course, since everything is still under active development, details of that interface and API can change at any time.

In addition to the interface, I've written an implementation. It is currently very rough and crude: logging far too much, in an awkward log format, and to just a single predefined file. But I plan on improving it a great deal, until it equals and then surpasses the existing legacy system, which will then be torn out (shrinking the the Drizzle core even more, and adding yet more multiprocessor performance).

Also planned: logging to syslog, and logging to table.
Tags: drizzle, mysql

  • Razors

    I'm getting ads for I think five different "all metal" "get the best shave of your life" "throw away the plastic" razor startups. They all seem to be…

  • Doing what needs to be done

    On May 1st, one of my co-residents found one of the feral rabbits that live in the area cuddled up against a corner of the house. It was seriously…

  • The CTO of Visa, after listening to me present

    Some years ago, I was asked to travel to the corporate meeting center to present at a presentation-fest to the CxO staff of Visa. Yes, the one with…

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded