From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Mysteriously varying index scan costs
Date: Mon, 24 Sep 2018 12:03:10 +0200
Message-ID: <1104a63e897f3c29f44e617f40a33f99a1d80e2c.camel@cybertec.at> (raw)
In-Reply-To: <CABOikdMLmBGTqcjXd98KHEhZtL_GyEXB5M4m-EjzbF7-Y-hzfw@mail.gmail.com>
References: <0979b9133184be5bdec8a99324854bf95656942f.camel@cybertec.at>
<CABOikdMLmBGTqcjXd98KHEhZtL_GyEXB5M4m-EjzbF7-Y-hzfw@mail.gmail.com>
Pavan Deolasee wrote:
> On Mon, Sep 24, 2018 at 2:20 PM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> >
> > But how can it be that the first run has to touch 74917 blocks,
> > while whe second run only needs to touch 1185?
> >
>
> The first index scan may have killed lots of index tuples.
So the first index scan visited lots of table tuples, found them
dead, and set the LP_DEAD flag on the corresponding index items
so that subsequent index scans could ignore them, right?
Thanks, that must be the correct explanation. It correlates nicely
with the dirtied pages, too.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
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: laurenz.albe@cybertec.at, pavan.deolasee@gmail.com
Subject: Re: Mysteriously varying index scan costs
In-Reply-To: <1104a63e897f3c29f44e617f40a33f99a1d80e2c.camel@cybertec.at>
References: <0979b9133184be5bdec8a99324854bf95656942f.camel@cybertec.at> <CABOikdMLmBGTqcjXd98KHEhZtL_GyEXB5M4m-EjzbF7-Y-hzfw@mail.gmail.com> <1104a63e897f3c29f44e617f40a33f99a1d80e2c.camel@cybertec.at>
* 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