Re: index-only-scan when there is an index on all columns - Mailing list pgsql-general

From Tom Lane
Subject Re: index-only-scan when there is an index on all columns
Date
Msg-id 28385.1519768691@sss.pgh.pa.us
Whole thread Raw
In response to Re: index-only-scan when there is an index on all columns  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: index-only-scan when there is an index on all columns  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: index-only-scan when there is an index on all columns  (Andres Freund <andres@anarazel.de>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> If one runs vacuum on a table (small or otherwise) that is currently
> choosing an index scan as its best plan how likely is it that post-vacuum
> an index-only plan would be chosen if the index type and column presence
> conditions are met?

Offhand I think it would always prefer IOS over regular indexscan if the
table is mostly all-visible.  The problem in this example was that other
choices dominate both.

> Also, I recall discussion that select statements will touch the visibility
> map (hence causing write I/O even in a read-only query) but [1] indicates
> that only vacuum will set them ddl will clear them.

Hm, I don't recall that, but I've not been involved in the last few rounds
of hacking on that mechanism.

            regards, tom lane


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: index-only-scan when there is an index on all columns
Next
From: "David G. Johnston"
Date:
Subject: Re: index-only-scan when there is an index on all columns