Re: Suggestion to add --continue-client-on-abort option to pgbench

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема Re: Suggestion to add --continue-client-on-abort option to pgbench
Дата
Msg-id 20251113210033.e6d73132b3dcd17e21e1cacc@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: Suggestion to add --continue-client-on-abort option to pgbench  (Chao Li <li.evan.chao@gmail.com>)
Список pgsql-hackers
On Thu, 13 Nov 2025 18:17:37 +0800
Chao Li <li.evan.chao@gmail.com> wrote:

> 
> 
> > On Nov 13, 2025, at 17:40, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > 
> > The following script:
> > 
> > \startpipeline
> > <queries list 1>
> > \syncpipeline
> > <queries list 2>
> > \endpipeline
> > 
> > can be considered equivalent to:
> > 
> > BEGIN;
> > <queries list 1>
> > END;
> > BEGIN;
> > <queries list 2>
> > END;
> 
> This looks like that every \sysnpipeline will start a new transaction, is that true?

Yes, it causes a new transaction to start.
In a pipeline, an implicit transaction block is started, and \syncpipeline closes it.
Then, a new implicit transaction begins.

Here’s a simple example to illustrate this:

$ cat pipeline_tx.sql 
drop table if exists tbl;
create table tbl (i int);
\startpipeline
insert into tbl values(1);
insert into tbl values(2);
\syncpipeline
insert into tbl values(3);
insert into tbl values(4);
\endpipeline
$ pgbench -f pipeline_tx.sql -t 1 -M extended -n > /dev/null
$ psql -c "select xmin, i from tbl"
 xmin | i 
------+---
 1268 | 1
 1268 | 2
 1269 | 3
 1269 | 4
(4 rows)

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>



В списке pgsql-hackers по дате отправления: