Re: Finding values of bind variables

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Finding values of bind variables
Дата
Msg-id 55259CD8.4000501@hogranch.com
обсуждение исходный текст
Ответ на Finding values of bind variables  ("Vasudevan, Ramya" <ramya.vasudevan@classmates.com>)
Ответы Re: Finding values of bind variables  ("Vasudevan, Ramya" <ramya.vasudevan@classmates.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error Creating DBlink Extension in 9.4.1
Следующее
От: Keith Fiske
Дата:
Сообщение: Background worker assistance & review