Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: ashutosh(dot)bapat(dot)oss(at)gmail(dot)com, orlovmg(at)gmail(dot)com, jian(dot)universality(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
Date: 2024-09-19 02:11:05
Message-ID: CAApHDvqNvRuhJOAH3-jK7hVp=5r4iSHoOLYDBEp50OghiLdmYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 19 Sept 2024 at 13:49, Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
> I also ran your query with count 1000.
>
> without the patch:
> Time: 3.655 ms
> Time: 4.123 ms
> Time: 2.163 ms
>
> wit the patch:
> Time: 3.641 ms
> Time: 2.356 ms
> Time: 2.347 ms
>
> It seems with the patch the performance is slightly better or almost
> same. I think the patch improves the performance without sacrificing
> the smaller iteration case.

You might need to use pgbench to get more stable results with such a
small test. If your CPU clocks down when idle, it's not going to clock
up as fast as you might like it to when you give it something to do.

Here's what I got when running 1000 iterations:

$ cat bench.sql
with recursive cte (a) as (select 1 union all select cte.a+1 from cte
where cte.a+1 <= 1000) select count(*) from cte;

master
$ for i in {1..5}; do pgbench -n -f bench.sql -T 10 -M prepared
postgres | grep latency; done
latency average = 0.251 ms
latency average = 0.254 ms
latency average = 0.251 ms
latency average = 0.252 ms
latency average = 0.253 ms

patched
$ for i in {1..5}; do pgbench -n -f bench.sql -T 10 -M prepared
postgres | grep latency; done
latency average = 0.202 ms
latency average = 0.202 ms
latency average = 0.207 ms
latency average = 0.202 ms
latency average = 0.202 ms (~24.2% faster)

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-09-19 03:00:00 Re: Should rolpassword be toastable?
Previous Message Tatsuo Ishii 2024-09-19 01:49:17 Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN