pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: stepya@ukr.net
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16089: Index only scan does not happen but expected
Date: Wed, 30 Oct 2019 15:13:16 +0100
Message-ID: <20191030141316.lkzqxc5isoc4xbgz@localhost> (raw)
In-Reply-To: <16089-89312196238e2c78@postgresql.org>
References: <16089-89312196238e2c78@postgresql.org>

Thank you for the report.

> On Wed, Oct 30, 2019 at 12:54:31PM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference:      16089
> Logged by:          Stepan Yankevych
> Email address:      stepya@ukr.net
> PostgreSQL version: 11.5
> Operating system:   CentOS Linux release 7.3.1611 (Core)
> Description:
>
> Not a real issue but rather performance leak. The issue is
> reproducible on the version 11.5 and 12.0 as well.

Does it mean, that on the previous versions you observed different
behaviour?

> The execution plan shows reading full partitions.l1_snapshot_201811
> Why do we need to read data from table. We have all needed information
> in the index that is smaller. I would expect index only scan
> (something like Oracle version of index fast full scan )

After a few experiments with this schema it looks like planner sometimes
prefers seq scan (parallel seq scan) instead of using the index due to
random read being more costly than sequential reads, even if it's
necessary to read more pages. And in fact at least in my tests this was
indeed faster. If you want to try out, it's possible to set
random_page_cost lower and seq_page_cost higher, and planner will most
likely choose a different plan, but whether it would be better or not
is not clear.





view thread (6+ messages)  latest in thread

Message-ID: <20191030141316.lkzqxc5isoc4xbgz@localhost>
Permalink:  ../20191030141316.lkzqxc5isoc4xbgz@localhost/
Also on:    postgresql.org/message-id/20191030141316.lkzqxc5isoc4xbgz@localhost

 · 

reply

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-bugs@postgresql.org
  Cc: 9erthalion6@gmail.com, stepya@ukr.net
  Subject: Re: BUG #16089: Index only scan does not happen but expected
  In-Reply-To: <20191030141316.lkzqxc5isoc4xbgz@localhost>
  References: <16089-89312196238e2c78@postgresql.org> <20191030141316.lkzqxc5isoc4xbgz@localhost>

* 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