PostgreSQL large single transaction slower than multiple transaction -
on postgres, saw case there huge amount of selects being handled in single transaction. slow, solution break selects multiple transactions, dramatically improved query time.
has come across such case? seems counter intuitive , wondering if there technical reason why multiple transactions preferable?
my theory it's easier db maintain acid properties multiple transactions opposed single gargantuan transaction.
i wouldn't expect selects issue if there nothing writing database. there aren't locking issues there speak of in pure select statement. issues happen when there writes.
if have writes, have deal fact autovacuum cannot clean items written after oldest write transaction started.
if seeing issues this, critical investigate locks (in pg_locks
) can queries , functions , find out these coming from.
keep in mind select
not select
, easy assume performance problems coming from.
Comments
Post a Comment