Re: [HACKERS] ANALYZE command progress checker
От | Tatsuro Yamada |
---|---|
Тема | Re: [HACKERS] ANALYZE command progress checker |
Дата | |
Msg-id | 59B0D830.6050203@lab.ntt.co.jp обсуждение исходный текст |
Ответ на | [HACKERS] ANALYZE command progress checker (vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp>) |
Список | pgsql-hackers |
On 2017/04/05 10:17, Masahiko Sawada wrote: > On Wed, Apr 5, 2017 at 1:49 AM, Robert Haas <robertmhaas@gmail.com> wrote: >> On Tue, Apr 4, 2017 at 4:57 AM, Amit Langote >> <Langote_Amit_f8@lab.ntt.co.jp> wrote: >>> Hmm, you're right. It could be counted with a separate variable >>> initialized to 0 and incremented every time we decide to add a row to the >>> final set of sampled rows, although different implementations of >>> AcquireSampleRowsFunc have different ways of deciding if a given row will >>> be part of the final set of sampled rows. >>> >>> On the other hand, if we decide to count progress in terms of blocks as >>> you suggested afraid, I'm afraid that FDWs won't be able to report the >>> progress. >> >> I think it may be time to push this patch out to v11. It was >> submitted one day before the start of the last CommitFest, the design >> wasn't really right, and it's not clear even now that we know what the >> right design is. And we're pretty much out of time. >> > > +1 > We're encountering the design issue and it takes more time to find out > right design including FDWs support. > > Regards, > > -- > Masahiko Sawada > NIPPON TELEGRAPH AND TELEPHONE CORPORATION > NTT Open Source Software Center Hi Vinayak, I found a typo in your patch: s/taht/that/ sampling.c /* Report total number of blocks taht will be sampled */ Then, regarding FDWs support, I believe it means postgres_fdw support (is my understanding right?). You might better to put pgstat_progress_update_param() into these functions, maybe. postgres_fdw.c - postgresAnalyzeForeignTable - postgresAcquireSampleRowsFunc And PgFdwAnalyzeState has these variables, hopefully you can get current number of rows as a progress indicator. sturuct PgFdwAnalyzeState ... /* collected sample rows */ HeapTuple *rows; /* array of size targrows*/ int targrows; /* target # of sample rows */ int numrows; /* # of sample rowscollected */ /* for random sampling */ double samplerows; /* # of rows fetched */ double rowstoskip; /* #of rows to skip before next sample */ ... I hope it will help you. Regards, Tatsuro Yamada
В списке pgsql-hackers по дате отправления: