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 1jdWQv-0001yE-A1 for pgsql-general@arkaria.postgresql.org; Tue, 26 May 2020 10:03:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdWQt-0007pR-Uv for pgsql-general@arkaria.postgresql.org; Tue, 26 May 2020 10:03:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdWQt-0007pK-N8 for pgsql-general@lists.postgresql.org; Tue, 26 May 2020 10:03:39 +0000 Received: from [87.230.15.127] (helo=lvps87-230-15-127.dedicated.hosteurope.de) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdWQm-0004AP-FT for pgsql-general@postgresql.org; Tue, 26 May 2020 10:03:39 +0000 Received: from snob.fritz.box (174.54.150.83.ftth.ewwwb.as8758.net [83.150.54.174]) by lvps87-230-15-127.dedicated.hosteurope.de (Postfix) with ESMTPSA id 6B9971D6EEF; Tue, 26 May 2020 12:03:00 +0200 (CEST) Subject: Re: Slow SELECT To: Frank Millman , pgsql-general@postgresql.org References: <0fb25867-78d2-d57f-134a-c3fccac7bbde@chagford.com> From: Christian Ramseyer Message-ID: <06c641a3-cd43-79f7-9e00-ed5d9f10028f@networkz.ch> Date: Tue, 26 May 2020 12:02:59 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <0fb25867-78d2-d57f-134a-c3fccac7bbde@chagford.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 87.230.15.127 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi On 26.05.20 09:22, Frank Millman wrote: > > I have looked at the EXPLAIN, but I don't really know what to look for. > I can supply it if that would help. > My favorite approach to tuning Postgres queries is: 1. Run EXPLAIN ANALYZE 2. Copy/Paste the output into the fantastic https://explain.depesz.com/ This will turn the somewhat hard-to-understand explain output into a nice colored structure. If it's not obvious from the orange-reddish boxes where the slowness comes from, please post the link here and somebody will certainly have some advice. Cheers Christian -- Christian Ramseyer, netnea ag Network Management. Security. OpenSource. https://www.netnea.com