Re: Interesting tight loop

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interesting tight loop
Дата
Msg-id 28400.1158242047@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Interesting tight loop  (Theo Schlossnagle <jesus@omniti.com>)
Список pgsql-hackers
Theo Schlossnagle <jesus@omniti.com> writes:
> In production today (8.1.4), I ran into a backend process that  
> wouldn't cancel right away -- minutes went by.

> It was in

> [0] TransactionIdIsCurrentTransactionId
> [1] HeapTupleSatisfiesSnapshot
> ...

> But the interesting thing is that there were 4.6 million elements in  
> the s->childXids list.  Which is why it took so damn long.

Well, I don't think TransactionIdIsCurrentTransactionId() itself is to
blame --- the loop over childXids is about as tight as such a loop could
possibly be (two indirect fetches and a comparison per iteration).
Even with 4.6M child Xids it could hardly take a second on any modern
machine.  I'm not inclined to add a CHECK_FOR_INTERRUPTS there.  The
problem should instead be blamed on something further down the call
stack ... did you save the full stack by any chance?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: CSStorm occurred again by postgreSQL8.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CSStorm occurred again by postgreSQL8.2