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 1kf1qT-0003Ne-TS for pgsql-performance@arkaria.postgresql.org; Tue, 17 Nov 2020 14:20:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kf1qQ-0001CW-Uq for pgsql-performance@arkaria.postgresql.org; Tue, 17 Nov 2020 14:20:30 +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 1kf1qQ-0001CP-A8 for pgsql-performance@lists.postgresql.org; Tue, 17 Nov 2020 14:20:30 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kf1qN-0006LM-9w for pgsql-performance@postgresql.org; Tue, 17 Nov 2020 14:20:28 +0000 Received: by mail-io1-xd2b.google.com with SMTP id n129so21265764iod.5 for ; Tue, 17 Nov 2020 06:20:26 -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=1KONcmhviH/93jr25XxGiuNK2J2aE1rvhMbOsDK1cXM=; b=I1rRtqR6OJ4BWVOOYPgKi6LlnNcCH34+WxLU1JjsSwB9WxPN3k1x3lzk2zTOKDMPDL YH1GLhiKj0EMA/2wbzsb8T5SDoTdOIhzCZlIGReurOndFyRZ/OrRm1JMREufkcYxdmvT 7aVphFUJthQj368qRSscI42t0CdccKNDs62zTZc4DfMy+sSTQofYGBAuXdaC7N/1GrqH vppIDVYfICzEpppmPt0NXiYPfIBs/b0dKbb5sL/IiK8FpSQdMfxbyscKadqPQUvQb8Sv WPymA6Sgtwx4NqeRsOyQ+xtvBgchm7JiSvXoG8Ke+WRR74jCZWxYQgjf4s3McbrIJ0pI dm7g== 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=1KONcmhviH/93jr25XxGiuNK2J2aE1rvhMbOsDK1cXM=; b=FqylD/JALpXkrxSkI2N619IRmqYc8wg9714zSuM/suzHsn2013jpu3PqmfePKc1aF2 lr5pbFFzAroAYypi2Dt57yLX/Ya2WsqoZQWpbzll9zMLaZCzzZ6blSKguqjW7yB7yfpK PAkvv87c0BDlB0LhxQegc2DlE+RzM4gdFG5NekLNcY6LkyCAjXi7Lcm3KQG6g+XyjIyP Q27FaYNbY3PQaa80ApAfVU1t9VVCwIBj4PhOIToetX8CDMJW3cnlxwmFzavqPkElVhMW +zdVJwkRny3U43cYJmNgWV/uXahDzvbHHdKn31EgUen3nosUt1Ask8PjJz2kPw+2i37A DnLg== X-Gm-Message-State: AOAM530nawtnNYA8KX2A1iEihrkneFyMzJNEqpXoqiutBQUnqs/ic3mF gLGWgPImi3Vh73mjO0zsbWZwtQabZbeg0A== X-Google-Smtp-Source: ABdhPJxSvt7dEtdu2DDW1NMEOVwOZolPiRhw6H2E+rQtNA8gtDk/s5SEcpJ5kBcHql545E0Bce5ikg== X-Received: by 2002:a02:a496:: with SMTP id d22mr3671907jam.78.1605622826189; Tue, 17 Nov 2020 06:20:26 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x77sm11975817ilk.78.2020.11.17.06.20.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 06:20:25 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 56DF0800773; Tue, 17 Nov 2020 08:20:24 -0600 (CST) Date: Tue, 17 Nov 2020 08:20:24 -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: <20201117142024.GA24784@telsasoft.com> References: 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 02:47:55PM +0100, Frits Jalvingh wrote: > But lately while migrating to Postgres 13 (from 9.6) we found that Postgres > does not (always) obey the enable_nestloop = false setting anymore: some > > The execution plan on Postgres 13.1: Could you send the plans under pg13 and pg9.6 as attachments ? What is the setting of work_mem ? I see the cost is dominated by 2*disable_cost, but I wonder whether the I/O cost of hash joins now exceeds that. Maybe hash_mem_multiplier helps you? GroupAggregate (cost=20008853763.07..20008853776.02 rows=370 width=68) Group Key: (COALESCE(adres_pe.id_s, '-1'::integer)), -- Justin