David Rowley <david.rowley@xxxxxxxxxxxxxxx> writes: > On 29 March 2018 at 18:26, Cory Tucker <cory.tucker@xxxxxxxxx> 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