Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kf3V6-0007TY-Dh for pgsql-performance@arkaria.postgresql.org; Tue, 17 Nov 2020 16:06:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kf3V3-0002Go-Go for pgsql-performance@arkaria.postgresql.org; Tue, 17 Nov 2020 16:06:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kf3V3-0002Gf-68 for pgsql-performance@lists.postgresql.org; Tue, 17 Nov 2020 16:06:33 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kf3Uw-0007GW-0i for pgsql-performance@postgresql.org; Tue, 17 Nov 2020 16:06:32 +0000 Received: by mail-io1-xd2e.google.com with SMTP id j23so5783698iog.6 for ; Tue, 17 Nov 2020 08:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2gXJXOPYkZlVRgwtBuO7uJBQjw5JeecQBYfQlEwD+CM=; b=Y4Q+qGTYiEBQnOJy3xm5It/HqqzCbQOVd0COG/FuiYOFTvdTlvP2fADevqJgT28OT6 hLXZrEyo6V7MgWaY583sAdGzk+OYl8PXjlqmykyRAz1iJPcBpV/jy62tpVcjXTGoQ8tu YtQiL1pFrc+yqwuRImmpx+xeIaK/oTl5ojPuzU1sbviFi57zAnolMUgufLL1GOA6X08k eZRmx45ASbJ/geEkR/pQ6TRcavKPJ5we6U9LbnGATZ/wO1pXbW1l98RjZbzp0+5IN9ZN w0oRPR4lqtsmS/Y785ccB0vCu73vBqeAUAER1jmHpOXfsELkaUCPZT8nkITJowkjog18 lQnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2gXJXOPYkZlVRgwtBuO7uJBQjw5JeecQBYfQlEwD+CM=; b=RLy7i7cI0E1fAvebsX2IBCyUyACthyrm2Bdk907i1SdrNcPlQXqjbAyPGQYwRscfmG LEHQSQv/3H9AkxutK841NpDZH/hEQxgQCfBdBIQYv2Jpju34ZJHFG0xskNsZddeogwqF OUbFiYhsaOCDx2EaAGQ4vBsI3D5QcUOCUAaA70uhBwXflz+3cLiwP9n9YKpEa1ae7UKW pKrxPH33AqydXsVyRRJOdHA7YXcxzAAUM40oSpSfAwTU+7bwk7Evgh2mr86xLSjQ/g1f w3VEDnUuKXM8G4NBUNIlA0cdQOquLSPGeGSn3+wRWkeue7DQT2RILdxkNCgiqzOfjeG0 1PKA== X-Gm-Message-State: AOAM531zK6zx+BuZGFPt+oK71O2Gm+A9zmGDS9HX3VL4c7sRm3K/DWcW VeZtRW0pU8q/S/gHxBL+vmMRdg== X-Google-Smtp-Source: ABdhPJz/PJgV+U3K4AmB/ZGLorxum5Kx78fbeabhAELxJMuVoKok7Si/oH7vWCDYOTX7Z9vnb1Hwcg== X-Received: by 2002:a02:90c6:: with SMTP id c6mr4227861jag.3.1605629184786; Tue, 17 Nov 2020 08:06:24 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id s18sm13143128iln.68.2020.11.17.08.06.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 08:06:24 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id ABC8F80032A; Tue, 17 Nov 2020 10:06:22 -0600 (CST) Date: Tue, 17 Nov 2020 10:06:22 -0600 From: Justin Pryzby To: Frits Jalvingh Cc: pgsql-performance@postgresql.org Subject: Re: Postgres using nested loops despite setting enable_nestloop to false Message-ID: <20201117160622.GB24784@telsasoft.com> References: <20201117142024.GA24784@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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