Bug #15014 | Performance problems with functions | ||
---|---|---|---|
Submitted: | 17 Nov 2005 12:51 | Modified: | 2 Feb 2006 13:58 |
Reporter: | Per-Erik Martin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S2 (Serious) |
Version: | 5.0 | OS: | Any (Any) |
Assigned to: | Per-Erik Martin | CPU Architecture: | Any |
[17 Nov 2005 12:51]
Per-Erik Martin
[17 Nov 2005 13:28]
Per-Erik Martin
The initial diagnosis turned out to be wrong. The cache may or may not be involved, but the performance problem remains, of course.
[17 Nov 2005 14:54]
Per-Erik Martin
I missed that there already is a bug report that's partially covers this: BUG#14946. So this one maybe supersedes that one (adding the UPDATE issue).
[31 Jan 2006 11:27]
Per-Erik Martin
This is no longer repeatable (in bk 5.0.19). Some change(s) between the end of December and now fixed the problem. (Hard to tell what, a lot of possibilities, and possibly a combination of things.) Now we don't see the extremely high overhead for functions with UPDATE and DO BENCHMARK we had before, only the normal function call overhead. (Admittedly a little high too, but accounted for.) mysql> -- Fill table mysql> call p(1000); Query OK, 1 row affected (0.06 sec) mysql> -- Update directly mysql> update t1 set s = concat('zip','zap'); Query OK, 1000 rows affected (0.01 sec) Rows matched: 1000 Changed: 1000 Warnings: 0 mysql> -- Update with function mysql> update t1 set s = f('foo','bar'); Query OK, 1000 rows affected (0.04 sec) Rows matched: 1000 Changed: 1000 Warnings: 0 mysql> -- Benchmark directly mysql> do benchmark(1000, concat('foo','bar')); Query OK, 0 rows affected (0.00 sec) mysql> -- Benchmark function mysql> do benchmark(1000, f('foo','bar')); Query OK, 0 rows affected (0.02 sec) mysql> -- Looping procedure directly mysql> call b1(1000); Query OK, 0 rows affected (0.02 sec) mysql> -- Looping procedure with function mysql> call b2(1000); Query OK, 0 rows affected (0.05 sec)
[1 Feb 2006 14:55]
Per-Erik Martin
Since it's not practical to have performance tests in the test suite, no test case was added. The current behaviour was tested in bk 5.0.19 though (optimized build).
[2 Feb 2006 13:58]
Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Documented in 5.0.19 changelog. Closed.