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 1gUVZQ-0007a9-64 for pgsql-general@arkaria.postgresql.org; Wed, 05 Dec 2018 11:42:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUVZO-0000HT-Uf for pgsql-general@arkaria.postgresql.org; Wed, 05 Dec 2018 11:42:22 +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 1gUVZO-0008CM-0k for pgsql-general@lists.postgresql.org; Wed, 05 Dec 2018 11:42:22 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUVZK-0002SN-QB for pgsql-general@lists.postgresql.org; Wed, 05 Dec 2018 11:42:20 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E30E12147B; Wed, 5 Dec 2018 06:42:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 05 Dec 2018 06:42:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=withers.org; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=NYsu0spLVwWw4nd+WNoiQoR+VCpPIji9OwPd0bPcGkU=; b=xMR634vinKWV 7LJj2pIWggx00pqnMSu8EWXQcCVouR840xcRcerpMcgLz9DvF3w1j5dicHeyaFSI mfpSHgtJc7xG7fjegu/hBWEi4xJTKkgFBouVM5q7NEQBqDbk698G1X47zPBD2NxJ tqP5K2RkTHW4r9qj83zRDR4rrDTSi5w= 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=NYsu0spLVwWw4nd+WNoiQoR+VCpPIji9OwPd0bPcG kU=; b=FveTMpCmWi+x2lzuxufZkZkbrofH1UAQWK6b9xJmPzdcCWVGuVEbPWlaE LQt4BEER6L2t30ZyInmLQ1mwM2vuTndl5pomXdbvwoL7oUo9L8lAsCCszSnsPuay ULl+GUuab6VhBjHtaz5fRahV7qs61Vqs/JPKCcI8ZENc0617CftU13hnD41Eblh5 80w5DUJJWUzDLzLEAcHBRUMpUh833zI4K1/qtHYMmQpwkYT0bvgwA30X9v8GW/TU ljnUicFP6EN7J1Oe7ge2Wa7C/aMJkVC9QMUsMusyXZCqz0xnWCQFuy3tu3h4VGo4 OQhIeRnICv8d9QtF+7b6LbxYl2dyg== X-ME-Sender: X-ME-Proxy: Received: from [172.25.22.95] (unknown [213.174.214.6]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B870E455C; Wed, 5 Dec 2018 06:42:16 -0500 (EST) Subject: Re: surprising query optimisation To: Gavin Flower , Stephen Frost Cc: pgsql-general@lists.postgresql.org References: <03a0af57-3ebc-5501-10ef-6a639c7c34b8@withers.org> <20181128224950.GS3415@tamriel.snowman.net> <5d7f8d97-32f3-fd88-44cc-948673579a71@withers.org> <20181130153327.GA3415@tamriel.snowman.net> <9a952022-82b1-a88d-07fb-72c47bc0f875@archidevsys.co.nz> From: Chris Withers Message-ID: <6ba91527-e19e-d6f1-8273-1561cdaba2ad@withers.org> Date: Wed, 5 Dec 2018 11:42:15 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:64.0) Gecko/20100101 Thunderbird/64.0 MIME-Version: 1.0 In-Reply-To: <9a952022-82b1-a88d-07fb-72c47bc0f875@archidevsys.co.nz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 30/11/2018 22:10, Gavin Flower wrote: > > I once optimised a very complex set queries that made extensive use of > indexes.  However, with the knowledge I have today, I would have most > likely had fewer and smaller indexes.  As I now realize, that some of my > indexes were probably counter productive, especially as I'd given no > thought to how much RAM would be required to host the data plus > indexes!  Fortunately, while the objective was to run all those queries > within 24 hours, they actually only took a couple of hours. So, interestingly, this box has 250GB memory in it, and even though I've set effective_cache_size to 200GB, I only see 9G of memory being used. How can I persuade postgres to keep more in memory? cheers, Chris