X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9477A5666F for ; Mon, 21 Mar 2005 22:07:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90865-04 for ; Mon, 21 Mar 2005 22:07:46 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 147705660C for ; Mon, 21 Mar 2005 22:07:45 +0000 (GMT) Received: by flake.decibel.org (Postfix, from userid 1001) id CDAE715258; Mon, 21 Mar 2005 16:07:45 -0600 (CST) Date: Mon, 21 Mar 2005 16:07:45 -0600 From: "Jim C. Nasby" To: Josh Berkus Cc: Stacy White , Tom Lane , Greg Stark , Alvaro Herrera , PFC , pgsql-performance@postgresql.org Subject: Re: What needs to be done for real Partitioning? Message-ID: <20050321220745.GS51784@decibel.org> References: <200503191202.38089.josh@agliodbs.com> <871xa9fyn4.fsf@stark.xeocode.com> <007401c52dd8$73395450$0200a8c0@grownups> <200503210955.03083.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200503210955.03083.josh@agliodbs.com> X-Operating-System: FreeBSD 4.11-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.025 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/423 X-Sequence-Number: 11128 On Mon, Mar 21, 2005 at 09:55:03AM -0800, Josh Berkus wrote: > Stacy, > > > Luckily they that had the chance to work with a truly fantastic DBA (the > > author of an Oracle Press performance tuning book even) before they could > > switch back. He convinced them to make some of their indexes global. > > Performance dramatically improved (compared with both the unpartitioned > > schema, and the partitioned-and-locally-indexed schema), and they've since > > stayed with partitioned tables and a mix of local and global indexes. > > Hmmm. Wouldn't Greg's suggestion of a bitmap index which holds information on > what values are found in what partition also solve this? Without 1/2 of > the overhead imposed by global indexes? > > I can actually see such a bitmap as being universally useful to the > partitioning concept ... for one, it would resolve the whole "partition on > {value}" issue. I suspect both will have their uses. I've read quite a bit about global v. local indexs in Oracle, and there are definately cases where global is much better than local. Granted, there's some things with how Oracle handles their catalog, etc. that might make local indexes more expensive for them than they would be for PostgreSQL. It's also not clear how much a 'partition bitmap' index would help. As for the 'seqscan individual partitions' argument, that's not going to work well at all for a case where you need to hit a relatively small percentage of rows in a relatively large number of partitions. SELECT ... WHERE customer_id = 1 would be a good example of such a query (assuming the table is partitioned on something like invoice_date). -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"