Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3BB8B63302C for ; Wed, 5 May 2010 17:25:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 38147-03 for ; Wed, 5 May 2010 20:25:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ormond.site5.com (ormond.site5.com [174.132.150.226]) by mail.postgresql.org (Postfix) with ESMTP id BB8D46322F9 for ; Wed, 5 May 2010 17:25:48 -0300 (ADT) Received: from [174.47.2.0] (helo=[10.30.21.166]) by ormond.site5.com with esmtpa (Exim 4.69) (envelope-from ) id 1O9lAB-0002Lw-62 for pgsql-performance@postgresql.org; Wed, 05 May 2010 15:25:47 -0500 From: Richard Yen Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: partioning tips? Date: Wed, 5 May 2010 13:25:46 -0700 Message-Id: <0E1248CD-551D-4F40-95AD-17336996ADAF@richyen.com> To: pgsql-performance@postgresql.org Mime-Version: 1.0 (Apple Message framework v1078) X-Mailer: Apple Mail (2.1078) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ormond.site5.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - richyen.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201005/13 X-Sequence-Number: 38597 Hello, I'm about to embark on a partitioning project to improve read = performance on some of our tables: db=3D# select relname,n_live_tup,pg_size_pretty(pg_relation_size(relid)) = from pg_stat_all_tables where schemaname =3D 'public' order by = n_live_tup desc limit 10; relname | n_live_tup | pg_size_pretty=20 -------------------------------------+------------+---------------- objects | 125255895 | 11 GB papers | 124213085 | 14 GB stats | 124202261 | 9106 MB exclusions | 53090902 | 3050 MB marks | 42467477 | 4829 MB student_class | 31491181 | 1814 MB users | 19906017 | 3722 MB view_stats | 12031074 | 599 MB highlights | 10884380 | 629 MB Problem is, I have foreign keys that link almost all of our tables = together (as a business requirement/IT policy). However, I know (er, I = have a gut feeling) that many people out there have successfully = deployed table partitioning, so I'm hoping to solicit some advice with = respect to this. I've looked at documentation, tried creating a = prototype, etc...looks like foreign keys have to go. But do they? What = have other people out there done to get their tables partitioned? Any input would be much appreciated. Thanks! --Richard=