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