Re: stats collector suddenly causing lots of IO

От: Tom Lane
Тема: Re: stats collector suddenly causing lots of IO
Дата: ,
Msg-id: 10744.1271435146@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: stats collector suddenly causing lots of IO  (Chris)
Ответы: Re: stats collector suddenly causing lots of IO  (Tom Lane)
Список: pgsql-performance

Скрыть дерево обсуждения

stats collector suddenly causing lots of IO  (Chris, )
 Re: stats collector suddenly causing lots of IO  (Cédric Villemain, )
 Re: stats collector suddenly causing lots of IO  (Alvaro Herrera, )
 Re: stats collector suddenly causing lots of IO  (Tom Lane, )
 Re: stats collector suddenly causing lots of IO  (Josh Kupershmidt, )
  Re: stats collector suddenly causing lots of IO  (Tom Lane, )
   Re: stats collector suddenly causing lots of IO  (Josh Kupershmidt, )
    Re: stats collector suddenly causing lots of IO  (Tom Lane, )
     Re: stats collector suddenly causing lots of IO  (Josh Kupershmidt, )
      Re: stats collector suddenly causing lots of IO  (Tom Lane, )
       Re: stats collector suddenly causing lots of IO  (Scott Carey, )
        Re: stats collector suddenly causing lots of IO  (Scott Carey, )
       Re: stats collector suddenly causing lots of IO  (Josh Kupershmidt, )
        Re: stats collector suddenly causing lots of IO  (Greg Smith, )
         Re: stats collector suddenly causing lots of IO  (Josh Kupershmidt, )
          Re: stats collector suddenly causing lots of IO  (Greg Smith, )
          Re: stats collector suddenly causing lots of IO  (Tom Lane, )
           Re: stats collector suddenly causing lots of IO  (Josh Kupershmidt, )
 Re: stats collector suddenly causing lots of IO  (Tom Lane, )
 Re: stats collector suddenly causing lots of IO  (Tom Lane, )
  Re: stats collector suddenly causing lots of IO  (Tom Lane, )

Josh Kupershmidt <> writes:
> I made a small half-empty table like this:
>   CREATE TABLE test_vacuum (i  int  PRIMARY KEY);
>   INSERT INTO test_vacuum (i) SELECT a FROM generate_series(1,500000) AS a;
>   DELETE FROM test_vacuum WHERE RANDOM() < 0.5;

> and then ran:
>   VACUUM test_vacuum;

> while an strace of the stats collector process was running. Then after
> a few seconds, found the PID of the VACUUM process, and ran strace on
> it. I killed them after the VACUUM finished. Outputs attached.

Huh.  The VACUUM strace clearly shows a boatload of TABPURGE messages
being sent:

sendto(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0\324\206<\24\321uC\24\320\350)\24\225\345,\24"..., 1000, 0, NULL, 0) =
1000
sendto(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0C\274?\24\365\323?\24\241N@\24\217\0309\24"..., 1000, 0, NULL, 0) = 1000
sendto(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0\375Z2\24\211\f@\0241\3047\24\357mH\24"..., 1000, 0, NULL, 0) = 1000
sendto(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0\242\3529\24\234K\'\24\17\227)\24\300\22+\24"..., 1000, 0, NULL, 0) =
1000

and the stats collector is receiving them:

recvfrom(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0\324\206<\24\321uC\24\320\350)\24\225\345,\24"..., 1000, 0, NULL, NULL)
=1000 
recvfrom(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0C\274?\24\365\323?\24\241N@\24\217\0309\24"..., 1000, 0, NULL, NULL) =
1000
recvfrom(7, "\2\0\0\0\350\3\0\0\5@\0\0\366\0\0\0\375Z2\24\211\f@\0241\3047\24\357mH\24"..., 1000, 0, NULL, NULL) = 1000

So this *should* have resulted in the stats file shrinking.  Did you
happen to notice if it did, after you did this?

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Josh Kupershmidt
Дата:
Сообщение: Re: stats collector suddenly causing lots of IO
От: Віталій Тимчишин
Дата:
Сообщение: Re: Planner not using column limit specified for one column for another column equal to first