Re: Analyze on temp table taking very long

Поиск
Список
Период
Сортировка
От Mahadevan, Mridula
Тема Re: Analyze on temp table taking very long
Дата
Msg-id 300035A46398FC4D8251A684DE0416737D3B8316@mvmexp01.tpt.imtn.com
обсуждение исходный текст
Ответ на Re: Analyze on temp table taking very long  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Thanks for the tip. I'll also check in the lock, it's a customer setup and we don't get access to the box very
frequently. 
Also
The code was something like this.

loop
    inserting data into the tmptbl
    analyze tmptbl
end loop

if I replace this with

loop
    inserting data into the tmptbl
end loop
analyze


It goes through fine.

-mridula



-----Original Message-----
From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Tuesday, March 22, 2011 3:57 PM
To: Mahadevan, Mridula
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Analyze on temp table taking very long

"Mahadevan, Mridula" <Mridula.Mahadevan@ironmountain.com> writes:
> This has been running fine for a while on multiple setups, large and small volumes. The setups all have the same
hardwareconfiguration. 

> On one particular setup with about 200k records and this analyze runs for 45min and then times out(statement timeout
isset to 45 min). typically this takes a few seconds at best. But when I move the analyze outside the loop everything
runsfine. 

Is it actually *running*, as in doing something, or is it just blocked?
I can't immediately think of any reason for some other process to have
a lock on a temp table that belongs to your process; but it seems
unlikely that ANALYZE would randomly take much longer than expected
unless something was preventing it from making progress.

Look into pg_locks and/or watch the backend with strace next time this
happens.

            regards, tom lane

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



The information contained in this email message and its attachments is intended only for the private and confidential
useof the recipient(s) named above, unless the sender expressly agrees otherwise. Transmission of email over the
Internetis not a secure communications medium. If you are requesting or have requested the transmittal of personal
data,as defined in applicable privacy laws by means of email or in an attachment to email, you must select a more
securealternate means of transmittal that supports your obligations to protect such personal data. If the reader of
thismessage is not the intended recipient and/or you have received this email in error, you must take no action based
onthe information in this email and you are hereby notified that any dissemination, misuse or copying or disclosure of
thiscommunication is strictly prohibited. If you have received this communication in error, please notify us
immediatelyby email and delete the original message.  


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Intel SSDs that may not suck
Следующее
От: Justin Pitts
Дата:
Сообщение: Re: Intel SSDs that may not suck