pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Nicolas Paris <niparisco@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: PG 9.3 materialized view VS Views, indexes, shared memory
Date: Thu, 5 Mar 2015 19:40:51 -0600
Message-ID: <54F905A3.7090602@BlueTreble.com> (raw)
In-Reply-To: <CA+ssMOS-LJ9woAtSj4xTK2gMXG8RvkmyE7DWfeP1k07TdKF8Qg@mail.gmail.com>
References: <CA+ssMOQSXAa5uOLZSeanUNtC1YuSVZfoovX73PxU_MQO4o59Hg@mail.gmail.com>
	<CAJghg4+dS5+BDtw6PWGj72hB8YpivMiBGmynEof012pY4yfjQg@mail.gmail.com>
	<CA+ssMOSXAxawWJTO60Vv3ecA1QYy0O8U139kuxLWv3bD11pLug@mail.gmail.com>
	<CAJghg4KV6=bkFEbTS9McG0MPWFLpc_YX1n36iy32o9WPvHNL+Q@mail.gmail.com>
	<CA+ssMOQS_PCL+K9VAYa9RSoTYRfR1R==dEmx9YBnu00Ws_nQug@mail.gmail.com>
	<CA+ssMOS-LJ9woAtSj4xTK2gMXG8RvkmyE7DWfeP1k07TdKF8Qg@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 2/20/15 12:09 PM, Nicolas Paris wrote:
> Well it seems that max  query size for CREATE INDEX is 8160 character in
> my 9.3 postgresql version.
> Then the only solution see is to add  a new boolean field : huge_table.view1
> and change predicat to "WHERE view1=1 "
> But I may have 800 views.. adding 800 new fields indexed to the huge
> table is actually not a good idea. Too bad
>
> Any idea to solve that partial view limitation?

If you have that many different views I doubt you want that many indexes 
anyway.

Have you tried just hitting the base table and indexes directly, either 
through plain views or just direct SQL?

Also, how frequently does data change in the huge table? This sounds 
like a case where the visibility map could make a huge difference.

By the way, if all the Mat Views are in one schema that's already in the 
search path, a very easy way to test this would be to create an 
equivalent set of regular views in a different schema (which you can 
probably do programmatically via pg_get_viewdef()) and then change the 
search_path to put the new schema before the old.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com


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



view thread (14+ messages)  latest in thread

Message-ID: <54F905A3.7090602@BlueTreble.com>
Permalink:  ../54F905A3.7090602@BlueTreble.com/
Also on:    postgresql.org/message-id/54F905A3.7090602@BlueTreble.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: Jim.Nasby@BlueTreble.com, niparisco@gmail.com
  Subject: Re: PG 9.3 materialized view VS Views, indexes, shared memory
  In-Reply-To: <54F905A3.7090602@BlueTreble.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