pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: jbaum@cmcrc.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #11221: pg_restore unusable for expensive matviews
Date: Thu, 19 Mar 2015 12:50:36 -0400
Message-ID: <20150319165036.GF6061@momjian.us> (raw)
In-Reply-To: <20140820021530.2534.43156@wrigleys.postgresql.org>
References: <20140820021530.2534.43156@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Wed, Aug 20, 2014 at 02:15:30AM +0000, jbaum@cmcrc.com wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      11221
> Logged by:          Jiri Baum
> Email address:      jbaum@cmcrc.com
> PostgreSQL version: 9.3.5
> Operating system:   Linux
> Description:        
> 
> When restoring a database with expensive materialized views, pg_restore
> issues the REFRESH MATERIALIZED VIEW commands without regard to whether
> indexes are valid yet or whether autoanalyze has completed.
> 
> As a result, if a materialized view is expensive and relies on indexes
> and/or good query plans, the restore will take prohibitively long.
> 
> This is likely to be a common use case, since there's not much point
> materializing views that are inexpensive.
> 
> Possible solution: pg_restore should have an option (default?) to wait for
> indexes to be valid and run ANALYZE before issuing the REFRESH MATERIALIZED
> VIEW commands, either in pg_restore itself or by adding commands to wait for
> (relevant or all) indexes to be valid.
> 
> Workaround: Hack stuff up out of the -l and -L options to pg_restore.
> 
> Possibly duplicates:
> http://www.postgresql.org/message-id/1403794157042-5809367.post@n5.nabble.com
> (not listed on the TODO wiki page)

I have added TODO entry:

	Delay REFRESH MATERIALIZED VIEW until dependent indexes are created
	
	    o  pg_restore unusable for expensive matviews 

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <20150319165036.GF6061@momjian.us>
Permalink:  ../20150319165036.GF6061@momjian.us/
Also on:    postgresql.org/message-id/20150319165036.GF6061@momjian.us

 · 

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: bruce@momjian.us, jbaum@cmcrc.com
  Subject: Re: BUG #11221: pg_restore unusable for expensive matviews
  In-Reply-To: <20150319165036.GF6061@momjian.us>
  References: <20140820021530.2534.43156@wrigleys.postgresql.org> <20150319165036.GF6061@momjian.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