News for hackers. Stuff that matters.
Re:Python Asyncio: The Complete Guide by kissgyorgy on Thursday November 10, 2022 @12:06PM (#33549638)
> reworking your DB access patterns may gain you more.

Nope: https://techspot.zzzeek.org/2015/02/15/asynchronous-python-a...

Re:Python Asyncio: The Complete Guide by matsemann on Thursday November 10, 2022 @01:25PM (#33550886)
I think you agree with the quote? Aka that asyncio doesn't give you a speedup, you might as well keep them the traditional way but instead focus on improving what you already have.
Re:Python Asyncio: The Complete Guide by nine_k on Thursday November 10, 2022 @01:27PM (#33550918)
I don't say that asyncio gives you nothing! Go for it with your DB access if you have already gone async in your design.

But often the lower-hanging fruit is doing more joins in the DB, fetching fewer columns, and writing your query more thoughtfully. Async only helps if you can do something while waiting for the DB to complete your query. A common anti-pattern, exacerbated by ORMs, is doing a bunch of small queries while passing bits of data between them in Python; moving that to asyncio won't help much, if any.

Re:Python Asyncio: The Complete Guide by calpaterson on Thursday November 10, 2022 @02:06PM (#33551448)
> But often the lower-hanging fruit is doing more joins in the DB, fetching fewer columns, and writing your query more thoughtfully.

Reluctant to add a "me-too" comment but I think you have it there. For whatever reason people are much keener to investigate different ways of scheduling IO than they are to investigate what the query plan looks like and why.

Re:Python Asyncio: The Complete Guide by _bohm on Thursday November 10, 2022 @02:23PM (#33551689)
It may not be the norm, but there are definitely apps/services out there that require heavy-duty database queries and can have their throughput bottlenecked by synchronous DB IO latency, and would benefit from asyncio on the database side. Also, SQLAlchemy supports asyncio now.