Re: Useless memoize path generated for unique join on primary keys

2022-05-03 Thread David Rowley
On Wed, 4 May 2022 at 00:21, Benjamin Coutu wrote: > Thanks David, using extended statistics for both (and only for both) tables > solved this problem. Oh, whoops. I did get that backwards. The estimate used by the Memoize costing code is from the outer side of the join, which is the extdataemp

Re: Useless memoize path generated for unique join on primary keys

2022-05-03 Thread Benjamin Coutu
> I'd say it's a pretty different problem. The cache hit ratio > discussion on that thread talks about underestimating the hit ratio. > That particular problem could only lead to Memoize plans *not* being > chosen when they maybe should be. Not the other way around, which is > your case. > > creat

Re: Useless memoize path generated for unique join on primary keys

2022-05-03 Thread David Rowley
On Tue, 3 May 2022 at 23:05, Benjamin Coutu wrote: > -> Memoize (cost=0.58..0.67 rows=1 width=16) (actual time=0.002..0.002 > rows=0 loops=4067215) > Cache Key: e2.field, e2.index > Cache Mode: logical > Hits: 0 Misses: 4067215 Evictions: 3228355 Overflows: 0 Memor