Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 014C59F9FAE for ; Tue, 4 Sep 2007 16:00:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 27267-01 for ; Tue, 4 Sep 2007 16:00:03 -0300 (ADT) X-Greylist: delayed 00:06:39.679139 by SQLgrey-1.7.5 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 0D14A9F9B2E for ; Tue, 4 Sep 2007 16:00:02 -0300 (ADT) Received: (qmail 15696 invoked by uid 0); 4 Sep 2007 18:53:21 -0000 Received: from 85.125.226.29 by www141.gmx.net with HTTP; Tue, 04 Sep 2007 20:53:21 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" Date: Tue, 04 Sep 2007 20:53:21 +0200 From: "Walter Mauritz" Message-ID: <20070904185321.221220@gmx.net> MIME-Version: 1.0 Subject: join tables vs. denormalization by trigger To: pgsql-performance@postgresql.org X-Authenticated: #1731027 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1/szWoZtFLs3bQU7O4jDGolHIHBg1RDkPWZ3DqOKj p+8kZ8KAfRHS5WL+Wme+iViYOOBLkBRgPgiQ== Content-Transfer-Encoding: 7bit X-GMX-UID: 6e+7LAIgaHItfak7PCUlaBliamdhZATC X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200709/27 X-Sequence-Number: 26572 Hi, I wonder about differences in performance between two scenarios: Background: Table A, ~50,000 records Table B, ~3,000,000 records (~20 cols) Table C, ~30,000,000 records (~10 cols) a query every 3sec. with limit 10 Table C depends on Table B wich depends on Table A, int8 foreign key, btree index * consider it a read only scenario (load data only in night, with time for vacuum analyze daily) * im required to show records from Table C, but also with some (~5cols) info from Table B * where clause always contains the foreign key to Table A * where clause may contain further 1-10 search parameter Scenario A) simply inner join Table B + C Scenario B) with use of trigger on insert/update I could push the required information from table B down to table C. -> so i would only require to select from table C. My question: 1) From your experience ... how much faster (approximately) in percent do you regard Scenario B faster than A ? 2) any other tips for such a read only scenario Thx for any attention :-) Walter -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail