Re: [BUGS] BUG #11500: PRIMARY KEY index not being used
Marko Tiikkaja <marko@joh.to>
From: Marko Tiikkaja <marko@joh.to>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <dgrowleyml@gmail.com>, pgsql-bugs@postgresql.org
Date: 2025-10-05T06:41:06Z
Lists: pgsql-bugs
On Sat, Oct 4, 2025 at 8:17 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > David Rowley <dgrowleyml@gmail.com> writes: > > On Sat, 4 Oct 2025 at 15:40, Marko Tiikkaja <marko@joh.to> wrote: > >> On Fri, Oct 3, 2025 at 16:31 Tom Lane <tgl@sss.pgh.pa.us> wrote: > >>> You haven't given us a lot to go on: no reproducible test case, > > >> I've provided two. Both make the planner look bad. > > You've provided *no* reproducible test case that makes the planner > look bad. The filled-in test case has two possibilities that are > both pretty cheap and the planner knows they are pretty cheap, so > it hardly matters which one it takes. You showed us a fragment > of a case where it chose a very expensive scan that it shouldn't > have, but no useful information about how to reproduce that. Hardly matters? I'd say 54.682 ms vs. 0.077 ms is a big deal. Especially because the planner doesn't seem to have any idea what the upper bound on the first one could be. .m