Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 32BD19F9A49 for ; Tue, 28 Aug 2007 12:22:27 -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 36194-07-2 for ; Tue, 28 Aug 2007 12:22:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.191]) by postgresql.org (Postfix) with ESMTP id 133659F9F14 for ; Tue, 28 Aug 2007 12:22:18 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id b27so1890081fka for ; Tue, 28 Aug 2007 08:22:17 -0700 (PDT) Received: by 10.82.162.14 with SMTP id k14mr16872322bue.1188314536837; Tue, 28 Aug 2007 08:22:16 -0700 (PDT) Received: by 10.82.158.11 with HTTP; Tue, 28 Aug 2007 08:22:11 -0700 (PDT) Message-ID: <428b865e0708280822u522391ecr5366bb5a6647f1aa@mail.gmail.com> Date: Tue, 28 Aug 2007 10:22:11 -0500 From: "Evan Carroll" To: pgsql-performance@postgresql.org Subject: 8.2 Query 10 times slower than 8.1 (view-heavy) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 24ee7a09934e31a7 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.312 tagged_above=0 required=5 tests=AWL=-0.185, BAYES_50=0.001, NO_DNS_FOR_FROM=1.496 X-Spam-Level: * X-Archive-Number: 200708/352 X-Sequence-Number: 26482 Dearest dragon hunters and mortal wanna-bes, I recently upgraded a system from Apache2/mod_perl2 to Lighttpd/fastcgi. The upgrade went about as rough as can be. While in the midst of a bad day, I decided to make it worse, and upgrade Pg 8.1 to 8.2. Most people I talk to seem to think 8.1 was a lemon release; not I. It worked excellent for me for the longest time, and I had no good reason to upgrade it, other than to just have done so. In the process, A query that took a matter of 2minutes, started taking hours. I broke that query up into something more atomic and used it as a sample. The following material is provided for your assisting-me-pleasure: the original SQL; the \ds for all pertinent views and tables; the output of Explain Analyze; and the original query. The original query both trials was: SELECT * FROM test_view where U_ID = 8; test_view.sql = http://rafb.net/p/HhT9g489.html 8.1_explain_analyze = http://rafb.net/p/uIyY1s44.html 8.2_explain_analzye = http://rafb.net/p/mxHWi340.html \d table/views = http://rafb.net/p/EPnyB229.html Yes, I ran vacuum full after loading both dbs. Thanks again, ask and I will provide anything else. I'm on freenode, in #postgresql, and can be found at all times with the nick EvanCarroll. -- Evan Carroll System Lord of the Internets me@evancarroll.com 832-445-8877