Mark Atwood (fallenpegasus) wrote,
Mark Atwood
fallenpegasus

MySQL User Defined Aggregate Function, how fast are they?

MySQL has User Defined Functions. These are loadable modules, written in C, that can be loaded into a running MySQL server, and used like a "native" built-in function.

A UDF can be an aggregate function. An aggregate function is one that takes in multiple rows, but emits only one result. For example, SUM() is a built-in aggregate function.

I just proved to myself via testing and benchmarking that user defined aggregate functions are about three times slower than the call interface to the built-in functions.

THREE TIMES SLOWER!


In about twelve hours I am supposed to be presenting a talk titled Using User-defined Functions and Aggregates to Speed Up Your Data Warehouse Processing.

Um. Yeah...

UPDATE:

It turns out to be a MacOS thing. On Linux, the performance penalty is less than 10%. Further research will surely be done.

The talk itself went reasonably well.
Tags: mysql
Subscribe
  • Post a new comment

    Error

    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 

  • 6 comments