PostgreSQL insert strategy: ORM, Core, or Psycopg3
Three ways to get rows into Postgres from Python and what each one costs: the SQLAlchemy ORM, SQLAlchemy Core, and Psycopg3 COPY. Includes the refactor that fixed a memory leak at 100,000 rows and a rule of thumb for choosing between them.