perf(estimator): executemany batch insert in _save_yandex_history_items (Refs #826) #832

Merged
bot-reviewer merged 1 commit from feat/826-yandex-executemany into main 2026-05-30 20:07:06 +00:00

1 commit

Author SHA1 Message Date
e4ad1f8f7a perf(estimator): executemany batch insert in _save_yandex_history_items (Refs #826)
Replace N+1 loop `for row in rows: db.execute(sql, row)` with single
`db.execute(sql, rows)` — SQLAlchemy Session passes list-of-dicts as
executemany, reducing round-trips to one per batch. Guard with `if rows:`
so empty batches skip the execute. Update unit tests to reflect one call
with a list instead of N calls with individual dicts.
2026-05-30 22:58:52 +03:00