Re: Asynchronous execution support for Custom Scan

Поиск
Список
Период
Сортировка
От Kazutaka Onishi
Тема Re: Asynchronous execution support for Custom Scan
Дата
Msg-id CAJuF6cOO9j6WLQ=jugUX6Gv5TwqBgdT8YSCo9C4VJbudm6nRAw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Asynchronous execution support for Custom Scan  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Ответы Re: Asynchronous execution support for Custom Scan  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Список pgsql-hackers
Hi, Fujii-san,

The asynchronous version "ctidscan" plugin is ready.
Please check this.
https://github.com/0-kaz/ctidscan/tree/async_sample

I've confirmed this works correctly by running SQL shown below.
The query plan shows 2 custom scan works asynchronously.

postgres=# LOAD 'ctidscan';
LOAD
postgres=# EXPLAIN ANALYZE SELECT * FROM t1 WHERE ctid BETWEEN
'(2,1)'::tid AND '(3,10)'::tid
UNION
SELECT * FROM (SELECT * FROM t1 WHERE ctid BETWEEN '(2,115)'::tid AND
'(3,10)'::tid);
                                                             QUERY
PLAN

------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate  (cost=3.55..5.10 rows=155 width=36) (actual
time=0.633..0.646 rows=130 loops=1)
   Group Key: t1.a, t1.b
   Batches: 1  Memory Usage: 48kB
   ->  Append  (cost=0.01..2.77 rows=155 width=36) (actual
time=0.035..0.590 rows=146 loops=1)
         ->  Async Custom Scan (ctidscan) on t1  (cost=0.01..1.00
rows=134 width=37) (actual time=0.009..0.129 rows=130 loops=1)
               Filter: ((ctid >= '(2,1)'::tid) AND (ctid <= '(3,10)'::tid))
               Rows Removed by Filter: 30
               ctid quals: ((ctid >= '(2,1)'::tid) AND (ctid <= '(3,10)'::tid))
         ->  Async Custom Scan (ctidscan) on t1 t1_1  (cost=0.01..1.00
rows=21 width=37) (actual time=0.003..0.025 rows=16 loops=1)
               Filter: ((ctid >= '(2,115)'::tid) AND (ctid <= '(3,10)'::tid))
               Rows Removed by Filter: 144
               ctid quals: ((ctid >= '(2,115)'::tid) AND (ctid <=
'(3,10)'::tid))
 Planning Time: 0.314 ms
 Execution Time: 0.762 ms
(14 rows)

Regards,


2022年8月26日(金) 17:18 Etsuro Fujita <etsuro.fujita@gmail.com>:
>
> Hi KaiGai-san,
>
> On Tue, Aug 23, 2022 at 6:26 PM Kohei KaiGai <kaigai@heterodb.com> wrote:
> > I internally suggested him to expand the ctidscan module for the PoC purpose.
> > https://github.com/kaigai/ctidscan
> >
> > Even though it does not have asynchronous capability actually, but
> > suitable to ensure
> > API works and small enough for reviewing.
>
> Seems like a good idea.
>
> Thanks!
>
> Best regards,
> Etsuro Fujita



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Column Filtering in Logical Replication
Следующее
От: Robert Haas
Дата:
Сообщение: Re: allowing for control over SET ROLE