pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Vladimir Ryabtsev <greatvovan@gmail.com>
Cc: tgl@sss.pgh.pa.us
Cc: ranade@nodalexchange.com
Cc: pgsql-performance@postgresql.org
Subject: Re: SELECT statement returns in 10seconds, but INSERT/CREATE TABLE AS with same SELECT takes 7 minutes
Date: Thu, 27 Sep 2018 19:12:08 -0500
Message-ID: <20180928001208.GL776@telsasoft.com> (raw)
In-Reply-To: <CAMqTPqkMHOBzNBqxsOQenEjBCs4vA7pevt0BLZc3CX9hY8ypUg@mail.gmail.com>
References: <CANrrCRxsC3wr711bjAJ4zK_16vF-qQHZXjSJTstbQt9kG5QDSw@mail.gmail.com>
	<24273.1538068894@sss.pgh.pa.us>
	<CAMqTPq=5KVOSKaxry0PFA8wVQWN8WsdycM=FSy1CUPUuGbDv7w@mail.gmail.com>
	<22616.1538080889@sss.pgh.pa.us>
	<CAMqTPqkMHOBzNBqxsOQenEjBCs4vA7pevt0BLZc3CX9hY8ypUg@mail.gmail.com>

On Thu, Sep 27, 2018 at 04:50:36PM -0700, Vladimir Ryabtsev wrote:
> Additionally, I think author can try CREATE STATISTICS on the bunch of
> columns used in join. Very low rows estimate for this join may come from
> multiplying selectivities for each column assuming they are independent.

MV statistics don't currently help for joins:
https://www.postgresql.org/message-id/flat/CAKJS1f-6B7KnDFrh6SFhYn-YbHYOXmDDAfd0XC%3DjJKZMCrfQyg%40m...

Justin




view thread (11+ messages)

Message-ID: <20180928001208.GL776@telsasoft.com>
Permalink:  ../20180928001208.GL776@telsasoft.com/
Also on:    postgresql.org/message-id/20180928001208.GL776@telsasoft.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, greatvovan@gmail.com, tgl@sss.pgh.pa.us, ranade@nodalexchange.com
  Subject: Re: SELECT statement returns in 10seconds, but INSERT/CREATE TABLE AS with same SELECT takes 7 minutes
  In-Reply-To: <20180928001208.GL776@telsasoft.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