Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YThGN-00023u-4N for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2015 01:41:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YThGM-00017w-IM for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2015 01:41:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YThGL-00017n-PX for pgsql-performance@postgresql.org; Fri, 06 Mar 2015 01:41:13 +0000 Received: from mail-bl2on0664.outbound.protection.outlook.com ([2a01:111:f400:fc09::664] helo=na01-bl2-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YThGG-0005Cr-Ee for pgsql-performance@postgresql.org; Fri, 06 Mar 2015 01:41:12 +0000 Received: from decina.local (24.55.12.91) by CY1PR11MB0347.namprd11.prod.outlook.com (25.161.165.15) with Microsoft SMTP Server (TLS) id 15.1.106.15; Fri, 6 Mar 2015 01:41:00 +0000 Message-ID: <54F905A3.7090602@BlueTreble.com> Date: Thu, 5 Mar 2015 19:40:51 -0600 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Nicolas Paris CC: pgsql-performance Subject: Re: PG 9.3 materialized view VS Views, indexes, shared memory References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [24.55.12.91] X-ClientProxiedBy: BY2PR06CA043.namprd06.prod.outlook.com (10.141.250.161) To CY1PR11MB0347.namprd11.prod.outlook.com (25.161.165.15) Authentication-Results: postgresql.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR11MB0347; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(52034003)(51704005)(377454003)(24454002)(479174004)(40100003)(15975445007)(86362001)(36756003)(1411001)(83506001)(80316001)(19580395003)(2950100001)(92566002)(42186005)(76176999)(110136001)(46102003)(54356999)(122386002)(62966003)(77156002)(87976001)(65816999)(87266999)(33656002)(47776003)(66066001)(59896002)(23676002)(50466002)(50986999)(65806001)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR11MB0347; H:decina.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002007)(5005006); SRVR:CY1PR11MB0347; BCL:0; PCL:0; RULEID:; SRVR:CY1PR11MB0347; X-Forefront-PRVS: 05079D8470 X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2015 01:41:00.5541 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR11MB0347 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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