From: | Günce Kaya <guncekaya14(at)gmail(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Partitioning with foreign tables. |
Date: | 2018-10-03 08:33:56 |
Message-ID: | CAAV2-mVNb=oHKcp80qOcj7U57eUGmMYd6kex77EgMA1sbBd_AA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
>
> If I insert a row to partitioned table which is in local, a partitioned
> table’s constraints should work. If I add a constraint on a partitioned
> table, I should be make sure I can not insert a row which is out of
> partitioned table’s constraints. But I could. I think, partitioned table’s
> constraints should work with regard to environment. If I work on local,
> constraints work for local tables and should not consider other
> environment’s constraints.
>
>
To be more clear, I would like to add EXPLAIN ANALYZE script.
artemis=# explain (analyze,verbose) insert into students values(2,'another
name');
QUERY
PLAN
--------------------------------------------------------------------------------------
------------------
Insert on public.students (cost=0.00..0.01 rows=1 width=36) (actual
time=1.536..1.53
9 rows=0 loops=1)
* Remote SQL: INSERT INTO public.students(id, name) VALUES ($1, $2)*
-> Result (cost=0.00..0.01 rows=1 width=36) (actual time=0.005..0.013
rows=1 loop
s=1)
Output: 2, 'another name'::character varying
Planning time: 0.063 ms
Execution time: 2.877 ms
(6 rows)
We use push-down for INSERT statement but I think constraints should be
checked before sending SQL statements then INSERT statements should be
perform.
If it's nature, why do we require to add unused constraint for FDW side
only?
--
Gunce Kaya
Linkedin <https://tr.linkedin.com/in/guncekaya> - Twitter
<https://twitter.com/gguncesi> - Blog
<http://www.guncekaya.blogspot.com.tr/>
From | Date | Subject | |
---|---|---|---|
Next Message | Samed YILDIRIM | 2018-10-03 12:47:30 | Re: Partitioning with foreign tables. |
Previous Message | Günce Kaya | 2018-10-03 08:23:35 | Partitioning with foreign tables. |