X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0E1CCD9079 for ; Fri, 4 Nov 2005 11:13:07 -0400 (AST) 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 18686-10 for ; Fri, 4 Nov 2005 15:13:03 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id CB3BCD8286 for ; Fri, 4 Nov 2005 11:13:05 -0400 (AST) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr2.postgresql.org (Postfix) with ESMTP id 5C1A7F13CB for ; Fri, 4 Nov 2005 15:13:10 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id jA4FCwvG016968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Nov 2005 08:13:01 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id jA4FCwMN089807; Fri, 4 Nov 2005 08:12:58 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id jA4FCwgG089806; Fri, 4 Nov 2005 08:12:58 -0700 (MST) (envelope-from mfuhr) Date: Fri, 4 Nov 2005 08:12:57 -0700 From: Michael Fuhr To: Michal Taborsky Cc: pgsql-performance@postgresql.org Subject: Re: Searching union views not using indices Message-ID: <20051104151257.GA89760@winnie.fuhr.org> References: <436B4836.7030300@mall.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <436B4836.7030300@mall.cz> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200511/75 X-Sequence-Number: 15332 On Fri, Nov 04, 2005 at 12:38:30PM +0100, Michal Taborsky wrote: > SELECT object_id FROM commonview WHERE link_id=1234567 > > The result is sequential scan on all tables, append, sort and then > filter scan on this whole thing. Which of course is slow as hell. We use > version 8.0.2. I couldn't duplicate this in 8.0.4; I don't know if anything's changed since 8.0.2 that would affect the query plan. Could you post the EXPLAIN ANALYZE output? It might also be useful to see the output with enable_seqscan disabled. Have the tables been vacuumed and analyzed recently? -- Michael Fuhr