pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: twoflower <standa.kurik@gmail.com>
To: pgsql-general@postgresql.org
Subject: Postgres 11 chooses seq scan instead of index-only scan
Date: Thu, 24 Jan 2019 07:23:27 -0700 (MST)
Message-ID: <1548339807217-0.post@n3.nabble.com> (raw)

I restored a dump of our production DB (running on 9.6) to a Postgres 11
server and wanted to run some basic benchmarks to see if there isn't some
unexpected performance drop.

One issue I cannot resolve is the new server using a parallel seq scan
instead of index-only scan for the following query:

select count(id) from history_translation

The table has about 123 million rows. The servers use identical
configuration. The hardware is similar (4 cores and 18 GB RAM for the 9.6
server vs. 26 GB RAM for the new one). In particular, all the *_cost
settings have the default value and the only possibly relevant settings with
non-default value are
shared_buffers = 2048MBwork_mem = 32MB

The query finishes in *39 seconds* on the 9.6 server and in *2 minutes* on
the 11 server.

Even when I effectively disable parallel queries (using set
max_parallel_workers_per_gather = 0), the new server chooses sequential scan
and, of course, takes much longer to finish the query. I tried recreating
the index and analyzing the table again, but it did not change anything.

Any help will be welcome.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

view thread (4+ messages)  latest in thread

Message-ID: <1548339807217-0.post@n3.nabble.com>
Permalink:  ../1548339807217-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1548339807217-0.post@n3.nabble.com

 · 

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-general@postgresql.org
  Cc: standa.kurik@gmail.com
  Subject: Re: Postgres 11 chooses seq scan instead of index-only scan
  In-Reply-To: <1548339807217-0.post@n3.nabble.com>
  References: <1548339807217-0.post@n3.nabble.com>

* 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