Re: unoptimized nested loops

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tim Kelly <gtkelly(at)dialectronics(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: unoptimized nested loops
Date: 2022-06-02 04:05:46
Message-ID: CAMkU=1whHwiBkt4t4e8Y85NT_ReLyo-qjvdpOROuW2N7dQCSug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 31, 2022 at 4:04 PM Tim Kelly <gtkelly(at)dialectronics(dot)com> wrote:

>
> c_db=>select count(id) from metadata where author like '%Kelly%';
>
> count
> -------
> 3558
> (1 row)
>

It would be interesting to see the explain of this. We know how many rows
it found, but not how many it thinks it will find.

> I do not see evidence that the nested loop is trying to reduce overhead
> by using the smaller set. It seems to want to scan on data first either
> way.
>

The planner probably doesn't know which one is smaller.

> I have run vacuum analyze, in the hopes that the optimizer is
> miscalculating, to no avail.

What version are you using?

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-06-02 04:32:40 Re: unoptimized nested loops
Previous Message David Rowley 2022-06-01 21:10:07 Re: unoptimized nested loops