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 1gmgFa-0007DA-7r for pgsql-general@arkaria.postgresql.org; Thu, 24 Jan 2019 14:45:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gmgFY-0002et-Tl for pgsql-general@arkaria.postgresql.org; Thu, 24 Jan 2019 14:45:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmgFY-0002el-LL for pgsql-general@lists.postgresql.org; Thu, 24 Jan 2019 14:45:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmgFW-0007DR-Mk for pgsql-general@postgresql.org; Thu, 24 Jan 2019 14:45:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x0OEiuO0016150; Thu, 24 Jan 2019 09:44:56 -0500 From: Tom Lane To: twoflower cc: pgsql-general@postgresql.org Subject: Re: Postgres 11 chooses seq scan instead of index-only scan In-reply-to: <1548339807217-0.post@n3.nabble.com> References: <1548339807217-0.post@n3.nabble.com> Comments: In-reply-to twoflower message dated "Thu, 24 Jan 2019 07:23:27 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16148.1548341096.1@sss.pgh.pa.us> Date: Thu, 24 Jan 2019 09:44:56 -0500 Message-ID: <16149.1548341096@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk twoflower writes: > One issue I cannot resolve is the new server using a parallel seq scan > instead of index-only scan for the following query: > select count(id) from history_translation You might need to vacuum the table to ensure that the planner thinks a reasonable proportion of the pages are all-visible (see pg_class.relallvisible). regards, tom lane