Re: postgres_fdw insert extremely slow
От | pabloa98 |
---|---|
Тема | Re: postgres_fdw insert extremely slow |
Дата | |
Msg-id | CAEjudX452F-MezbU6gauHaPx8EUkrafsnuuuCJD52ifiHkK5Ag@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: postgres_fdw insert extremely slow (Laurenz Albe <laurenz.albe@cybertec.at>) |
Ответы |
Re: postgres_fdw insert extremely slow
|
Список | pgsql-general |
On Thu, Nov 26, 2020 at 8:25 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Thu, 2020-11-26 at 09:07 -0800, Adrian Klaver wrote:
> So even if Mats where to break this query:
>
> INSERT INTO foreign.labels (address, labels)
> SELECT address_id, ARRAY_AGG(name) AS labels
> FROM labels
> GROUP BY 1
> LIMIT 100;
>
> down into something like this:
>
> INSERT INTO foreign.labels (address, labels)
> VALUES (), (), (), ();
>
> postgres_fdw would send it as individual INSERTs?
Yes, that's the way the FDW API works.
I can confirm that it is NOT like FDW API work. I have the same problem and in the fdw database it receives:
INSERT INTO foreign.labels (address, labels) VALUES ();
One value at a time.
Same scenario, same performance. No network related. It is just a batch insert is split into 1 insert by row.
Pablo
В списке pgsql-general по дате отправления: