Re: Query is slower with a large proportion of NULLs in several columns

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Lars Bergeson <larsavatar(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Query is slower with a large proportion of NULLs in several columns
Date: 2021-12-21 05:07:01
Message-ID: CAKFQuwbCpgNDdMZhoSM-1LNEdO+ThZtRJkBtUb4b+9JaJV93kg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Monday, December 20, 2021, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:

> On Mon, Dec 20, 2021 at 08:11:42PM -0800, Lars Bergeson wrote:
> > ok, here are results after I did:
> > set max_parallel_workers_per_gather = 0;
> >
> > HashAggregate (cost=1676432.13..1676432.16 rows=3 width=15) (actual
> time=19908.343..19908.345 rows=5 loops=1)
> > I/O Timings: read=532369.898
> > Execution Time: 19908.383 ms
>
> > HashAggregate (cost=1390580.70..1390580.72 rows=2 width=15) (actual
> time=30369.758..30369.761 rows=5 loops=1)
> > I/O Timings: read=6440851.540
> > Execution Time: 30369.796 ms
>
> > Still taking 10X more I/O to read the smaller table. Very odd.
>
> If I'm not wrong, it's even worse than that ?
> It takes 20 or 30sec to run the query - but it says the associated I/O
> times
> are ~500sec or ~6000sec ?
>
> What architecture and OS/version are you running ?
> How did you install postgres? From a package or compiled from source ?
>

The docs indicate you’ll only see I/O Timing information if using EXPLAIN
BUFFERS but I’m not seeing any of the other buffer-related information in
these plans. Thoughts?

David J.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message David G. Johnston 2021-12-21 05:08:59 Re: Query is slower with a large proportion of NULLs in several columns
Previous Message Tom Lane 2021-12-21 05:01:28 Re: Query is slower with a large proportion of NULLs in several columns