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 1l0VBU-0000WC-Vs for pgsql-general@arkaria.postgresql.org; Fri, 15 Jan 2021 19:55:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l0VBT-00043y-VP for pgsql-general@arkaria.postgresql.org; Fri, 15 Jan 2021 19:54:59 +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 1l0VBT-00043p-1d for pgsql-general@lists.postgresql.org; Fri, 15 Jan 2021 19:54:59 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0VBQ-0002Sm-Nf for pgsql-general@postgresql.org; Fri, 15 Jan 2021 19:54:57 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 10431FD3; Fri, 15 Jan 2021 14:54:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 15 Jan 2021 14:54:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=d xafLUZE3wKw3GiuAlNUeTc+gQOBso34v6jId+NcIlw=; b=fvexrGh4DuIKkoUMV cazY+tFX8+ZOuNteS2PECfjvYYEp9ykBq9DTjy7cDJvNZ+I6VN8IOMd00pOFpDBb cm8/Avo+WHgSTUo4UeIGrLA0BzeYsUYeETKduI5hYr4zpfihHgrEAhlyAgGn62A8 jmG+9tFR1C0EYbJq3VSqoo2/RMKFQaXso7YIJLkWbe33UVleJ3WqOA1labVSindc JR88zln7cC5+Z3XsZkxI6wKG172mW1Ae3TwdH2GP+WOExdk+5Pliuy36s/yHOtCw BuH1EtZzJwYdklcQkFn+xsg8kJSUSRSJBvBwUMnkKPFA4yMTIJ8ulaQ2EYppCd0H BqL0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=dxafLUZE3wKw3GiuAlNUeTc+gQOBso34v6jId+NcI lw=; b=CULT+H9i4JYM3SULPxn9m2tmsaGTsFbIyOgAOs9QLECk/yr2/FfRrAmxP bez1/tbiGNcJslWjCsGVkDlXRmJf2HAZeD5MlbGPbw3zFf7LFUhDYONeuD49jHwz f7FWRjJvjB1VNymbCA98eczz3QkbSHWWEq7wTZg5TDwTry+qzIrPy1DTk108/qvb +o6flDI1x1Y9inM++sJyY7ZiU3uos+4roaRuDuBqRZ0A4sefUibgJ8j7MXwz5x9v LUw248Li1Yl9XXDiXDVKxzp8t9szefmM8566uHd7yT8J8rXwq6/71UK/GBc9Bpq4 XSjkcqWuYtWrncl/k4wEmQPAcdR+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtddvgddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeetjedvteffjeeuvdelieeffeehuedthffgvdfhhffh kedvudevgedvjedufefgveenucfkphepjeehrddujedvrddugedrudejnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgr vhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.4] (75-172-14-17.tukw.qwest.net [75.172.14.17]) by mail.messagingengine.com (Postfix) with ESMTPA id 2B53124005B; Fri, 15 Jan 2021 14:54:54 -0500 (EST) Subject: Re: Accounting for between table correlation To: Alexander Stoddard References: <65a6db71-9182-1f0a-02c7-39cd011b34dd@aklaver.com> Cc: pgsql-general From: Adrian Klaver Message-ID: Date: Fri, 15 Jan 2021 11:54:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/15/21 10:49 AM, Alexander Stoddard wrote: Please reply to list also. Ccing list. > > So to be clear, the process imports the data, then you run a query and > it completes in x time, you then ANALYZE the same data and it runs in y > time. Is that correct? > > The process imports data, ANALYZE is run and then queries run in x time. > A subsequent ANALYZE, may or may not, change the time to y. > x may be greater or less than y for any given pair of runs, and the > difference is vast. Two very different performance domains, due to the > plan, I believe. If I am correctly reading the EXPLAIN plans the row > estimates are always way off (and low), regardless of if a high or low > performing plan is actually chosen. Well I'm going to say this is not going to get a useful answer without some concrete numbers. Too many variables involved to just start guessing at solutions. > > Thank you, > Alex -- Adrian Klaver adrian.klaver@aklaver.com