On 4/8/2015 10:55 AM, Vasudevan, Ramya wrote:

state | idle in transaction

query | INSERT into distributed_events (type, action, id, properties) VALUES ($1, $2, $3, $4) RETURNING "distributed_event_id"


idle means its NOT executing any query... thats just the LAST query it executed. idle in transaction means someone/something started a transaction but isn't actively doing anything so there's a pending transaction thats idle.

backend_start | 2015-04-06 20:55:07.921089-07


this client connected on that date/time

xact_start       | 2015-04-06 21:16:26.820822-07


the transaction started at that date/time (about 21 minutes after creating the connection)

query_start | 2015-04-06 21:16:26.834017-07


the last query started about 0.014 seconds after creating the transaction

state_change | 2015-04-06 21:16:26.834144-07

the state_change to idle-in-transaction took place about 0.0001 seconds later (so the insert took all of a millisecond).

What date/time was it when you did that select from pg_stat_activity ? thats how long this transaction has been pending, which if its more than a few seconds to at most a minute, is almost certainly a 'very bad thing' unless the transaction is actively crunching data.

if you're using a client such as JDBC which autowraps queries in transactions by default, you need to invoke COMMIT's when you're done doing that unit of work.



--
john r pierce, recycling bits in santa cruz

Reply via email to