On Tue, Nov 17, 2020 at 04:58:45PM +0100, Frits Jalvingh wrote: > Hi Justin, thanks for your help! > I have attached both plans, both made with set enable_nestloop = false in > the attachments. > On the Postgresql 13 server work_mem is 64MB. It cannot really be higher > there because Postgresql does not control its use of memory, setting it > higher on this VM will cause the OOM killer to kill Postgresql for some > queries. Can you try to get an explain just for this query with either increased work_mem or hash_mem_multiplier ? Or possibly by messing with the cost parameters, including seq_page_cost. Making all cost_* params 1000x smaller might allow the disable cost to be effective. -- Justin