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

From David Rowley
Subject Re: Bad Query Plans on 10.3 vs 9.6
Date
Msg-id CAKJS1f84ufJ-GJSj=7QUaRiNDE58wLVD3GH_La_wdfNSaJLWtA@mail.gmail.com
Whole thread Raw
In response to Re: Bad Query Plans on 10.3 vs 9.6  (Cory Tucker <cory.tucker@gmail.com>)
Responses Re: Bad Query Plans on 10.3 vs 9.6  (Cory Tucker <cory.tucker@gmail.com>)
List pgsql-general
'On 30 March 2018 at 03:21, Cory Tucker <cory.tucker@gmail.com> wrote:
>> 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.

> I'm happy to try to dig into this one more, however, I'm not familiar with
> this value.  What should I be looking for here?

Each table in your database has an entry in the pg_class table. Something like:

SELECT relallvisible from pg_class where oid = 'build.household'::regclass;

would show you the value, however, I think a problem here is unlikely
since that would just control the likelihood of an index-only-scan vs
an index-scan. You're getting a Seq-scan, which I imagine is going to
be quite a bit more expensive than even an index scan.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-general by date:

Previous
From: Cory Tucker
Date:
Subject: Re: Bad Query Plans on 10.3 vs 9.6
Next
From: Cory Tucker
Date:
Subject: Re: Bad Query Plans on 10.3 vs 9.6