Re: Bad Query Plans on 10.3 vs 9.6 - Mailing list pgsql-general

From Tom Lane
Subject Re: Bad Query Plans on 10.3 vs 9.6
Date
Msg-id 13699.1522331221@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bad Query Plans on 10.3 vs 9.6  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: Bad Query Plans on 10.3 vs 9.6  (Cory Tucker <cory.tucker@gmail.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: "Alvar C.H. Freude"
Date:
Subject: Re: Question about buffers_alloc in pg_stat_bgwriter view formonitoring
Next
From: Cory Tucker
Date:
Subject: Re: Bad Query Plans on 10.3 vs 9.6