From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Hadi Moshayedi <hadi@citusdata.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: index-only-scan when there is an index on all columns
Date: Tue, 27 Feb 2018 16:58:11 -0500
Message-ID: <28385.1519768691@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwan3avGvqhX=jB4EcMOUeD7P2yp_8-7YpToZnx=4KXb2Q@mail.gmail.com>
References: <CA+_kT_f6fNS71Z6Dd-hca4-YeLTHgOgKOydE2W0zVwJdr534SA@mail.gmail.com>
<25619.1519765684@sss.pgh.pa.us>
<CAKFQuwan3avGvqhX=jB4EcMOUeD7P2yp_8-7YpToZnx=4KXb2Q@mail.gmail.com>
"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
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.g.johnston@gmail.com, hadi@citusdata.com
Subject: Re: index-only-scan when there is an index on all columns
In-Reply-To: <28385.1519768691@sss.pgh.pa.us>
References: <CA+_kT_f6fNS71Z6Dd-hca4-YeLTHgOgKOydE2W0zVwJdr534SA@mail.gmail.com> <25619.1519765684@sss.pgh.pa.us> <CAKFQuwan3avGvqhX=jB4EcMOUeD7P2yp_8-7YpToZnx=4KXb2Q@mail.gmail.com> <28385.1519768691@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