On 2017/04/05 10:17, Masahiko Sawada wrote:
On Wed, Apr 5, 2017 at 1:49 AM, Robert Haas <robertmh...@gmail.com> wrote:
On Tue, Apr 4, 2017 at 4:57 AM, Amit Langote
<langote_amit...@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 rows collected */

    /* 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



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

Reply via email to