# Serious performance issue with MySQL.jl

**URL:** <https://discourse.julialang.org/t/serious-performance-issue-with-mysql-jl/29289>\
**Category:** Data\
**Created:** [September 29, 2019, 11:05am UTC](https://discourse.julialang.org/t/serious-performance-issue-with-mysql-jl/29289 "2019-09-29T11:05:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sh4pe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sh4pe/32/10537_2.png) [@Sh4pe](https://discourse.julialang.org/u/Sh4pe)\
**Post date:** [September 29, 2019, 11:05am UTC](https://discourse.julialang.org/t/serious-performance-issue-with-mysql-jl/29289/1 "2019-09-29T11:05:29Z")

</div>

Hi there!

I hope that any `MySQL.jl` experts are out there. I’ve posted this issue already as [#130](https://github.com/JuliaDatabases/MySQL.jl/issues/130) there and I hope to increase visibility by adding a topic here as well.

In [this test](https://github.com/Sh4pe/MySQL.jl/blob/issue_130_reproduction/test/issue_130.jl) on my fork of MySQL.jl, I’ve managed to reproduce the problem.

I create an empty table with certain column types and 65 columns. Calling `iterate(query)` on it hangs forever (at least longer than 40 minutes, then I killed it). The problem seems to be a generated function named `generate_namedtuple` (located in `src/types.jl` in the MySQL.jl repo). Generating the quoted expression inside the function works quickly, but it appears that the compilation of the function then takes forever. For more information, see my comment made today on the issue `#130` (link above).

So this problem might also be related to a metaprogramming issue there. I’m fairly new to Julia, so I could really use some help there.

Thank you in advance! 🙂

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [October 3, 2019, 1:54am UTC](https://discourse.julialang.org/t/serious-performance-issue-with-mysql-jl/29289/2 "2019-10-03T01:54:23Z")

</div>

Sorry for the slow response! I’m happy to help dig in to find out what’s going on here. I’m a bit tied up with trying to finish a big refactoring in another package right now, but I should be able to help with the issue you opened up soon.

---

<div class="post-metadata">

**Author:** ![Sh4pe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sh4pe/32/10537_2.png) [@Sh4pe](https://discourse.julialang.org/u/Sh4pe)\
**Post date:** [October 3, 2019, 9:31pm UTC](https://discourse.julialang.org/t/serious-performance-issue-with-mysql-jl/29289/3 "2019-10-03T21:31:24Z")

</div>

Thank you, I’d appreciate this very much. I suspect that the bottleneck is the compilation of the `Expr` generated by [generate\_namedtuple](https://github.com/JuliaDatabases/MySQL.jl/blob/70472ffd9479575805fb04267777d14791c2a2cc/src/types.jl#L134-L141). If I find out something new, I’ll post it here or in [#130](https://github.com/JuliaDatabases/MySQL.jl/issues/130).

Thank you!
