Comments on: In Application and Database Design, Small Things Can Have a Big Impact https://www.percona.com/blog/application-and-database-design-small-things-can-have-a-big-impact/ Tue, 11 Jan 2022 07:47:28 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: sjmudd https://www.percona.com/blog/application-and-database-design-small-things-can-have-a-big-impact/#comment-10973487 Tue, 11 Jan 2022 07:47:28 +0000 https://www.percona.com/blog/?p=79653#comment-10973487 “This combined with the MySQL Connector/Python lead to almost a 50% reduction in database throughput (the 3.10.0 release saw a regression). However, this performance change was not seen either in my PostgreSQL testing or in testing the mysqlclient connector. It happened only when running the pure python version of the MySQL connector.”

… in my PostgreSQL testing … ?

I guess you meant … in my MySQL testing ?

]]>
By: Matt Yonkovit https://www.percona.com/blog/application-and-database-design-small-things-can-have-a-big-impact/#comment-10973482 Thu, 06 Jan 2022 19:12:00 +0000 https://www.percona.com/blog/?p=79653#comment-10973482 In reply to lefred (@lefred).

Hello Lefred!

Yes I mentioned it defaulted back to the pure python lib. I will revisit when the next version is supported with 3.10. I tried to stick with the common methods so I did use pip. My goal here is to highlight something small developers may not be aware of that could have a big impact. In this case there does appear to be something with the pure Python drivers and 3.10. Hopefully when 3.10 is officially supported things will perform normally.

Matt

]]>
By: lefred (@lefred) https://www.percona.com/blog/application-and-database-design-small-things-can-have-a-big-impact/#comment-10973472 Wed, 05 Jan 2022 18:07:54 +0000 https://www.percona.com/blog/?p=79653#comment-10973472 Hi Matt,
The current version of MySQL Connector Python (8.0.27) doesn’t support Python 3.10 (next one will). Therefore in your test your connector is not using the C extension and falls back to pure Python (you can see it matches the pymysql numbers). This means that in your test you are comparing pure Python versus C which of course doesn’t make many sense.
This is not a regression as with Python 3.10 you are not using the C extension.
My guess is that you upgraded Connector/Python using pip, and since Python 3.10 is not supported yet, the universal package which doesn’t contain any C extension was installed.
You can run the following command with your Python 3.9 and 3.10 interpreter, you will then see the difference:
python -c “import _mysql_connector”

]]>