pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Cory Tucker <cory.tucker@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Bad Query Plans on 10.3 vs 9.6
Date: Thu, 29 Mar 2018 09:47:01 -0400
Message-ID: <13699.1522331221@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f-E1Y-7+fNZ_PheBhhnqNEcUkT7oKJJSh6YL+Q9e_hFAQ@mail.gmail.com>
References: <CAG_=8kDXE=qcUOH3ekhXhq2p4anqpK6Cr0iXgkeWFt60MfTaCw@mail.gmail.com>
	<CAKJS1f-E1Y-7+fNZ_PheBhhnqNEcUkT7oKJJSh6YL+Q9e_hFAQ@mail.gmail.com>

David Rowley <david.rowley@2ndquadrant.com> writes:
> On 29 March 2018 at 18:26, Cory Tucker <cory.tucker@gmail.com> wrote:
>> The plan on 9.6 v 10.3 are effectively identical except in 9.6 the planner
>> decides to use an index only scan on the primary key and in 10.3 it does a
>> sequential scan.  The problem is the sequential scan is for a table of 75M
>> rows and 25 columns so its quiet a lot of pages it has to traverse.

> How certain are you that all the indexes match on each instance?

Another possibility is that 10.3 sees the index-only scan as too expensive
because it thinks most of the table isn't all-visible.  Comparing
pg_class.relallvisible values might be informative.

			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <13699.1522331221@sss.pgh.pa.us>
Permalink:  ../13699.1522331221@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13699.1522331221@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, cory.tucker@gmail.com
  Subject: Re: Bad Query Plans on 10.3 vs 9.6
  In-Reply-To: <13699.1522331221@sss.pgh.pa.us>
  References: <CAG_=8kDXE=qcUOH3ekhXhq2p4anqpK6Cr0iXgkeWFt60MfTaCw@mail.gmail.com> <CAKJS1f-E1Y-7+fNZ_PheBhhnqNEcUkT7oKJJSh6YL+Q9e_hFAQ@mail.gmail.com> <13699.1522331221@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox