Re: Naive question about multithreading/multicore

From: Marc SCHAEFER <alphanet-postgresql-general(at)alphanet(dot)ch>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Naive question about multithreading/multicore
Date: 2024-10-14 07:30:07
Message-ID: ZwzIf8SGQVcrqBC9@alphanet.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

On Sun, Oct 13, 2024 at 08:16:04AM +1300, Thomas Munro wrote:
> > template1=> SELECT COUNT(*) FROM pg_class a, pg_class b, pg_class c;
> >
> > I see only one 100% CPU PostgreSQL process.
>
> If you set set min_parallel_table_scan_size = 0 then it uses

Without it, it uses one CPU and takes about 8.5 s (count is 57512456).

With it, it is indeed parallel (multiple CPU used) and it takes about 6s.

As this is on a machine with slow disks, it is perfectly ok, I just
wanted to see the CPU parallelism in action.

Thank you!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Wienhold 2024-10-14 10:29:41 Re: Hello, how should I fix it?
Previous Message Ron Johnson 2024-10-14 07:09:13 Re: repmgr 5.4.1 dependend package on RHEL9