skip to Main Content

PostgreSQL slow COMMITs

I see lots of slow COMMITs in my logs : 2023-10-06 14:35:47 CEST Tx[0] cmd[COMMIT PREPARED] PID[16591] DB[db_XX] LOG: duration: 1049.941 ms execute <unnamed>: COMMIT PREPARED '131077_AAAAAAAAAAAAAP//ZGKVXjMhkrRlCESsBTdiSzE=_AAAAAAAAAAAAAP//ZGKVXjMhkrRlCESsBTdiWAAAAAQAAAAA' 2023-10-06 14:35:47 CEST Tx[0] cmd[COMMIT PREPARED] PID[24320] DB[db_XX] LOG: duration: 1049.209 ms execute…

VIEW QUESTION

Postgresql – sqlalchemy listens_for() doesn't trigger

I have working listens_for function, which inserts LoadHistory object before updating Load: @event.listens_for(Load, 'before_update') def before_update_load(mapper, connection, target): current_load_select = select(load_fields).where(Load.id == target.id) insert_history = insert(LoadHistory).from_select(load_history_fields, current_load_select) connection.execute(insert_history) And the task is to have similar function but which will insert…

VIEW QUESTION
Back To Top
Search