You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The building (select(...).where(...)) and compilation (see AsyncpgDatabase) of SQL queries by SQLAlchemy is a process that is a CPU-expensive task which is repeated a lot in webservers.
Sqlalchemy 2.0 actually has a smart system of caching compilation (which is the largest part of the CPU intensive tasks) but we don't use this caching system because the built-in asyncpg backend of sqlalchemy adds a lot of overhead.
SQLAlchemy does have a technique to add "bind params" in a compiled query. Lots of our queries might be pre-compiled in that way.
The text was updated successfully, but these errors were encountered:
The building (
select(...).where(...)
) and compilation (seeAsyncpgDatabase
) of SQL queries by SQLAlchemy is a process that is a CPU-expensive task which is repeated a lot in webservers.Sqlalchemy 2.0 actually has a smart system of caching compilation (which is the largest part of the CPU intensive tasks) but we don't use this caching system because the built-in
asyncpg
backend of sqlalchemy adds a lot of overhead.SQLAlchemy does have a technique to add "bind params" in a compiled query. Lots of our queries might be pre-compiled in that way.
The text was updated successfully, but these errors were encountered: