Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLFtt-00061h-1q for pgsql-performance@arkaria.postgresql.org; Fri, 18 Oct 2019 00:13:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iLFtr-0001zg-JQ for pgsql-performance@arkaria.postgresql.org; Fri, 18 Oct 2019 00:13:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLFtr-0001zO-1D for pgsql-performance@lists.postgresql.org; Fri, 18 Oct 2019 00:13:47 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iLFtl-0005Kf-Kg for pgsql-performance@postgresql.org; Fri, 18 Oct 2019 00:13:45 +0000 Received: by mail-wm1-x331.google.com with SMTP id b24so4303162wmj.5 for ; Thu, 17 Oct 2019 17:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-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=LyfCX92PHCcE454lJ9eaKnVerAGLJ2zqYxQmEF3D3pM=; b=fCA6ilr8PCv4u7z2tQGZjFTfCdrjarDSa/QBxhWh2wgGG7Q3CKfE7nuq7GwPmuo2CN gwBp42pQ8UE6XkRM5YisK/f52/yeo6U5N/J7oz9WuH6uczZcprNidf8amkBlcC/TMK/7 evnSexecc5kqYjn7mFkHbroJbMdcx0TNorrwJjjAJjP2icL4WajWSeIZ8x9GH7x2y6gM f3SBuvxzAlEW2J/Tfu/dEfZiyWi6pLvZVuaEq6dblm8x0IsVI2g2gcon13LTd5OnkJy1 yRYAG/EjwXN4Kko7hi7twndcGeFvULzzVA8nnmKfJwBhTtCS6DdssuFA4kOpoKEiVWlx XQRQ== 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=LyfCX92PHCcE454lJ9eaKnVerAGLJ2zqYxQmEF3D3pM=; b=J8e8F4fnJDzKwvMFBcol3beoXMwbkWNjVAaJtLQ89vua/tBAIyY5whBggTcJP3Utio 0qFBiD3tbPVWIGzUMWOSAhVNFzg40PG/IwK4HYllpKk5qC36IAqNHtJxeMXw0j/ojgyP 9r9ZyTA7NhfsSWaesYVIgBlWI4XiLNzYlbSk+wPTOpfkmGs6d3RhumxyPgCLoatnjYjq Y0iTZfHX2Djh2ukhmlJp9ynYxzkuRc4aDfOqQuAHzqlqo/M0fT/jux8vKSun24xRCZGs Zdos8OgY4c6YYCttJZgS+O3qtAnc6t4MOElKuFRMoqgUy73Iz6HZqxmjy3nRjLJTGiB9 xzQQ== X-Gm-Message-State: APjAAAVhewxy+TyW6oGYxKFi3URMMBgAXZxTz023njDkfZd/2FTisCgU 4+qKwSZhxSE/7XpQo9aQq0Bwvg== X-Google-Smtp-Source: APXvYqwDBlnxoV/I3rUNwPadRO7ghgYg6TrPdmue4T4dfzxypJMaMVWyTMX/IglGGJb0v/GRibSBDQ== X-Received: by 2002:a05:600c:21d7:: with SMTP id x23mr4981294wmj.6.1571357619368; Thu, 17 Oct 2019 17:13:39 -0700 (PDT) Received: from localhost (net-188-219-235-30.cust.vodafonedsl.it. [188.219.235.30]) by smtp.gmail.com with ESMTPSA id h18sm3463069wrr.78.2019.10.17.17.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:13:35 -0700 (PDT) Date: Fri, 18 Oct 2019 02:13:34 +0200 From: Tomas Vondra To: Michael Lewis Cc: postgres performance list Subject: Re: Reading explain plans- row estimates/actuals on lower nodes vs next level up Message-ID: <20191018001334.uhjcp7kpbj46gl5e@development> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Oct 17, 2019 at 03:15:21PM -0600, Michael Lewis wrote: >https://explain.depesz.com/s/Caa5 > >I am looking at this explain analyze output and seeing a nested loop >towards the lowest levels with pretty bad estimate vs actual (2.3k vs 99k), >but the things that feed that nested loop seem like the estimates are >rather close (index scans with 11 estimated vs 30 actual and 3350 vs >3320)... why does the higher node have such a different estimate vs actual >ratio? > This is usually a sign of non-uniform distribution for the join columns, and/or correlation between sides of the join. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services