EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
521 stars 160 forks source link

Support Batch insert like postgres_fdw of postgresql-14 #240

Open MinhLA1410 opened 2 years ago

MinhLA1410 commented 2 years ago

Currently, we already implement batch insert like postgres_fdw from postgresql-14. I would like to contribute them into repository and community. If you have interest? I will create pull request for share this feature.

Summary modification:

Reference testcase of postgres_fdw.sql in postgres_fdw:

alter server mysql_svr options (add batch_size '10');

explain (verbose, costs off)
insert into grem1 (a) values (1), (2);
                                             QUERY PLAN                                             
----------------------------------------------------------------------------------------------------
 Insert on public.grem1
   Remote query: INSERT INTO `mysql_fdw_post`.`gloc1_post14`(`id`, `a`, `b`) VALUES (?, ?, DEFAULT)
   Batch Size: 10
   ->  Values Scan on "*VALUES*"
         Output: NULL::integer, "*VALUES*".column1, NULL::integer
(5 rows)