Re: SQL/MED estimated time of arrival?

From: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Eric Davies <eric(at)barrodale(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SQL/MED estimated time of arrival?
Date: 2010-11-08 12:08:26
Message-ID: 20101108210825.50C6.6989961C@metrosystems.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 5 Nov 2010 16:27:49 +0900
Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com> wrote:
> On Fri, Nov 5, 2010 at 4:00 PM, Shigeru HANADA
> <hanada(at)metrosystems(dot)co(dot)jp> wrote:
> >> > * am_beginscan()        -> first call of FdwRoutine.Iterate()?
> >> It might be good to have a separated "beginscan" method if we use
> >> asynchronous scans in multiple foreign servers in one query
> >
> > You mean that separated beginscan (FdwRoutine.BeginScan?) starts
> > asynchronous query and returns immediately, and FdwRoutine.Iterate
> > returns result of that query?
>
> Yes. Each BeginScan() in the executor node tree will be called at
> the beginning of executor's run. The callback should not block
> the caller. OTOH, Iterate() are called at the first time tuples
> in the node are required.

Please find attached WIP patch for BeginScan. Postgresql_fdw has been
changed to use server-side cursor for sample. It's DECLAREd with HOLD
option to avoid transaction management, though.

Other changes since 20101025 patch are:

- Some document fixes.
- Don't call ConnectServer from ExecInitForeignScan. Instead,
postgresql_fdw calls it from pgOpen(). This change is only trial
and would be removed later.
- Add "schema" column to output of \det psql command.
- New \dE psql command shows list of foreign tables in \d format.
- \d+ <foreign table> psql command shows per-column options.

If the changes (at least adding BeginScan) are OK, I'll clean the
patch up and post it soon.

Regards,
--
Shigeru Hanada

Attachment Content-Type Size
fdw_select_cursor.patch.gz application/octet-stream 99.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-11-08 13:40:10 Re: B-tree parent pointer and checkpoints
Previous Message Shigeru HANADA 2010-11-08 11:06:32 Re: SQL/MED estimated time of arrival?