Re: Improving worst-case merge join performance with often-null foreign key

2023-04-26 Thread Steinar Kaldager
On Sun, Apr 23, 2023 at 11:30 AM Richard Guo wrote: > On Sat, Apr 22, 2023 at 11:21 PM Tom Lane wrote: >> Hmm. I don't entirely understand why the existing stop-at-nulls logic >> in nodeMergejoin.c didn't fix this for you. Maybe somebody has broken >> that? See the commentary for MJEvalOuterVa

Re: Improving worst-case merge join performance with often-null foreign key

2023-04-24 Thread Richard Guo
On Sun, Apr 23, 2023 at 5:29 PM Richard Guo wrote: > On Sat, Apr 22, 2023 at 11:21 PM Tom Lane wrote: > >> Steinar Kaldager writes: >> > First-time potential contributor here. We recently had an incident due >> > to a sudden 1000x slowdown of a Postgres query (from ~10ms to ~10s) >> > due to a

Re: Improving worst-case merge join performance with often-null foreign key

2023-04-23 Thread Richard Guo
On Sat, Apr 22, 2023 at 11:21 PM Tom Lane wrote: > Steinar Kaldager writes: > > First-time potential contributor here. We recently had an incident due > > to a sudden 1000x slowdown of a Postgres query (from ~10ms to ~10s) > > due to a join with a foreign key that was often null. We found that i

Re: Improving worst-case merge join performance with often-null foreign key

2023-04-22 Thread Tom Lane
Steinar Kaldager writes: > First-time potential contributor here. We recently had an incident due > to a sudden 1000x slowdown of a Postgres query (from ~10ms to ~10s) > due to a join with a foreign key that was often null. We found that it > was caused by a merge join with an index scan on one jo