Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YVFZu-0005xV-1H for pgsql-performance@arkaria.postgresql.org; Tue, 10 Mar 2015 08:31:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YVFZt-0000yV-GT for pgsql-performance@arkaria.postgresql.org; Tue, 10 Mar 2015 08:31:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YVFZr-0000vS-Jw for pgsql-performance@postgresql.org; Tue, 10 Mar 2015 08:31:47 +0000 Received: from mail-bl2on0617.outbound.protection.outlook.com ([2a01:111:f400:fc09::617] helo=na01-bl2-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YVFZn-0000rx-Dz for pgsql-performance@postgresql.org; Tue, 10 Mar 2015 08:31:45 +0000 Received: from decina.attlocal.net (2602:306:ce8b:3460:856c:45b8:7d3:ac80) by BN3PR11MB0340.namprd11.prod.outlook.com (25.161.220.22) with Microsoft SMTP Server (TLS) id 15.1.106.15; Tue, 10 Mar 2015 08:31:36 +0000 Message-ID: <54FEABE1.60402@BlueTreble.com> Date: Tue, 10 Mar 2015 03:31:29 -0500 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: <54F905A3.7090602@BlueTreble.com> <54F97414.9040208@BlueTreble.com> In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2602:306:ce8b:3460:856c:45b8:7d3:ac80] X-ClientProxiedBy: BLUPR07CA0030.namprd07.prod.outlook.com (10.255.223.143) To BN3PR11MB0340.namprd11.prod.outlook.com (25.161.220.22) Authentication-Results: postgresql.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR11MB0340; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(479174004)(24454002)(51704005)(377454003)(42186005)(62966003)(53416004)(2950100001)(65816999)(46102003)(15975445007)(36756003)(40100003)(77156002)(86362001)(33656002)(76176999)(551934003)(92566002)(122386002)(54356999)(65806001)(19580395003)(65956001)(47776003)(110136001)(50466002)(23676002)(50986999)(83506001)(93886004)(64126003)(87976001)(1411001)(85282002)(336755003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR11MB0340; H:decina.attlocal.net; 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)(5002009)(5005006); SRVR:BN3PR11MB0340; BCL:0; PCL:0; RULEID:; SRVR:BN3PR11MB0340; X-Forefront-PRVS: 051158ECBB X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2015 08:31:36.3939 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR11MB0340 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 3/9/15 8:17 AM, Nicolas Paris wrote: > (sorry for top-posting, gmail does not help.) *shakes fist at gmail* > Thanks to your advice Jim, I have done an other test : > No partial indexes, just a partial index on boolean columns does the > job. (I get same perfs as MV) > CREATE INDEX ..ON (BoolColumnX) WHERE BoolColumnX IS TRUE > > Then VIEW = > SELECT colA....colZ > FROM huge_table > WHERE BoolColumnX IS TRUE > > Then this only index is used 800times (for each bool col) and saves > place as it does'nt indexes NULL values, and does no replicate. subsets. > Moreover the huge indexes are allways loaded in cache memory. Cool. :) > According to this link > http://postgresql.nabble.com/NULL-saves-disk-space-td4344106.html > NULL values do not take place if only one other column are null for > that row. > Boolean takes 1 byte wheras smallint 2bytes. > Then the space problem is not anymore a problem with boolean columns > 95% empty > > One thing that is really great with postgresql is transaction for > drop table cascade, that allow te restore all stuf index, views on a > rollback if problem in loading appears. > I hope using one transaction to drop/load many table is not a > performance issue ? Why are you dropping and re-loading? You mentioned it before and it sounded like it had something to do with adding columns, but you don't have to drop and reload to add a column. -- 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