pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Kohei KaiGai <kaigai@heterodb.com>
Cc: Kazutaka Onishi <onishi@heterodb.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Subject: Re: TRUNCATE on foreign table
Date: Tue, 13 Apr 2021 16:17:12 +0900
Message-ID: <2209ecd8-0382-cbcb-5717-15da49535237@oss.nttdata.com> (raw)
In-Reply-To: <CAOP8fzZf+=RQFmwLRw5s1KKgApuXmYPC76nmUZGck4=e7AJj8Q@mail.gmail.com>
References: <CAJuF6cMWDDqU-vn_knZgma+2GMaout68YUgn1uyDnexRhqqM5Q@mail.gmail.com>
	<CAJuF6cMV8oBTR-1T=5d6g-XQM_mXu+kTwzbY+PeQx4mOr2xbRg@mail.gmail.com>
	<e1d29b4c-0a3d-9e42-9575-a9373b593aa3@oss.nttdata.com>
	<CAOP8fzbDMAS78vD=J183SRXzUJfJgPqudgab++FNRDAS3Eq93w@mail.gmail.com>
	<66e78949-4747-941c-7966-60d9cd1aad99@oss.nttdata.com>
	<CAOP8fzajfK4vUe0s0YAOehjaFxvcecdvv2JdzeR6mZ-V3fLVbw@mail.gmail.com>
	<d5df2e94-f643-6409-5cd4-fa1c2ebd41fa@oss.nttdata.com>
	<CAOP8fzbKh1V_n-huDmzxQRsMRZ5qNb+2wo5khKOrweGgx6pBrg@mail.gmail.com>
	<43f71643-5068-8a77-4bda-005b0ff7bd4f@oss.nttdata.com>
	<CAOP8fzYY=xkj_ke3h-cHO08S6WKfcja0uNPmGjNYo50rm66+6Q@mail.gmail.com>
	<551ed8c1-f531-818b-664a-2cecdab99cd8@oss.nttdata.com>
	<CAOP8fzaWkX7O3QmKtJ9DEtBfwaR5+OL2KfycnYNrxPC9zEG2QQ@mail.gmail.com>
	<eac9329f-f285-2044-1974-b3d0d0aa5950@oss.nttdata.com>
	<CAOP8fzYgM=bxsDgtnucx4k_QUdUknri4UEdPxr9bkkfqRYoRog@mail.gmail.com>
	<CAOP8fzZf+=RQFmwLRw5s1KKgApuXmYPC76nmUZGck4=e7AJj8Q@mail.gmail.com>



On 2021/04/13 14:22, Kohei KaiGai wrote:
> Let me remind the discussion at the design level.
> 
> If postgres_fdw (and other FDW drivers) needs to consider whether
> ONLY-clause is given
> on the foreign tables of them, what does a foreign table represent in
> PostgreSQL system?
> 
> My assumption is, a foreign table provides a view to external data, as
> if it performs like a table.
> TRUNCATE command eliminates all the segment files, even if a table
> contains multiple
> underlying files, never eliminate them partially.
> If a foreign table is equivalent to a table in SQL operation level,
> indeed, ONLY-clause controls
> which tables are picked up by the TRUNCATE command, but never controls
> which portion of
> the data shall be eliminated. So, I conclude that
> ExecForeignTruncate() shall eliminate the entire
> external data on behalf of a foreign table, regardless of ONLY-clause.
> 
> I think it is more significant to clarify prior to the implementation details.
> How about your opinions?

I'm still thinking that it's better to pass all information including
ONLY clause about TRUNCATE command to FDW and leave FDW to determine
how to use them. How postgres_fdw should use the information about ONLY
is debetable. But for now IMO that users who explicitly specify ONLY clause for
foreign tables understand the structure of remote tables and want to use ONLY
in TRUNCATE command issued by postgres_fdw. But my opinion might be minority,
so I'd like to hear more opinion about this, from other developers.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (117+ messages)  latest in thread

Message-ID: <2209ecd8-0382-cbcb-5717-15da49535237@oss.nttdata.com>
Permalink:  ../2209ecd8-0382-cbcb-5717-15da49535237@oss.nttdata.com/
Also on:    postgresql.org/message-id/2209ecd8-0382-cbcb-5717-15da49535237@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, kaigai@heterodb.com, onishi@heterodb.com, bharath.rupireddyforpostgres@gmail.com, zyu@yugabyte.com, amitlangote09@gmail.com, ibrar.ahmad@gmail.com, ashutosh.bapat.oss@gmail.com
  Subject: Re: TRUNCATE on foreign table
  In-Reply-To: <2209ecd8-0382-cbcb-5717-15da49535237@oss.nttdata.com>
  References: <CAJuF6cMWDDqU-vn_knZgma+2GMaout68YUgn1uyDnexRhqqM5Q@mail.gmail.com> <e1d29b4c-0a3d-9e42-9575-a9373b593aa3@oss.nttdata.com> <CAOP8fzbDMAS78vD=J183SRXzUJfJgPqudgab++FNRDAS3Eq93w@mail.gmail.com> <66e78949-4747-941c-7966-60d9cd1aad99@oss.nttdata.com> <CAOP8fzajfK4vUe0s0YAOehjaFxvcecdvv2JdzeR6mZ-V3fLVbw@mail.gmail.com> <d5df2e94-f643-6409-5cd4-fa1c2ebd41fa@oss.nttdata.com> <CAOP8fzbKh1V_n-huDmzxQRsMRZ5qNb+2wo5khKOrweGgx6pBrg@mail.gmail.com> <43f71643-5068-8a77-4bda-005b0ff7bd4f@oss.nttdata.com> <CAOP8fzYY=xkj_ke3h-cHO08S6WKfcja0uNPmGjNYo50rm66+6Q@mail.gmail.com> <551ed8c1-f531-818b-664a-2cecdab99cd8@oss.nttdata.com> <CAOP8fzaWkX7O3QmKtJ9DEtBfwaR5+OL2KfycnYNrxPC9zEG2QQ@mail.gmail.com> <eac9329f-f285-2044-1974-b3d0d0aa5950@oss.nttdata.com> <CAOP8fzYgM=bxsDgtnucx4k_QUdUknri4UEdPxr9bkkfqRYoRog@mail.gmail.com> <CAOP8fzZf+=RQFmwLRw5s1KKgApuXmYPC76nmUZGck4=e7AJj8Q@mail.gmail.com> <2209ecd8-0382-cbcb-5717-15da49535237@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox