Re: unoptimized nested loops - Mailing list pgsql-general

From Jeff Janes
Subject Re: unoptimized nested loops
Date
Msg-id CAMkU=1whHwiBkt4t4e8Y85NT_ReLyo-qjvdpOROuW2N7dQCSug@mail.gmail.com
Whole thread Raw
In response to unoptimized nested loops  (Tim Kelly <gtkelly@dialectronics.com>)
Responses Re: unoptimized nested loops
List pgsql-general
On Tue, May 31, 2022 at 4:04 PM Tim Kelly <gtkelly@dialectronics.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

pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: unoptimized nested loops
Next
From: Tom Lane
Date:
Subject: Re: unoptimized nested loops