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 079C73A5335 for ; Mon, 22 Nov 2004 21:46:22 +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 92435-01 for ; Mon, 22 Nov 2004 21:46:19 +0000 (GMT) Received: from ms-smtp-02-eri0.ohiordc.rr.com (ms-smtp-02-smtplb.ohiordc.rr.com [65.24.5.136]) by svr1.postgresql.org (Postfix) with ESMTP id A853D3A4407 for ; Mon, 22 Nov 2004 21:46:17 +0000 (GMT) Received: from enzo.mascari.com (dhcp065-024-156-214.columbus.rr.com [65.24.156.214]) by ms-smtp-02-eri0.ohiordc.rr.com (8.12.10/8.12.7) with ESMTP id iAMLkEJl004111 for ; Mon, 22 Nov 2004 16:46:14 -0500 (EST) Received: from [192.168.2.1] (ferrari.mascari.com [192.168.2.1]) by enzo.mascari.com (8.12.8/8.12.8) with ESMTP id iAMLkB97025595; Mon, 22 Nov 2004 16:46:11 -0500 Message-ID: <41A25E20.2050503@mascari.com> Date: Mon, 22 Nov 2004 16:46:08 -0500 From: Mike Mascari User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mike Mascari Cc: pgsql-performance@postgresql.org Subject: Re: Slow execution time when querying view with WHERE clause References: <41A25C3B.3040608@mascari.com> In-Reply-To: <41A25C3B.3040608@mascari.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mascari-MailScanner-Information: Please contact the ISP for more information X-Mascari-MailScanner: Found to be clean X-Mascari-MailScanner-SpamCheck: not spam, SpamAssassin (score=0, required 6, autolearn=not spam) X-MailScanner-From: mascarm@mascari.com X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/338 X-Sequence-Number: 9292 Mike Mascari wrote: > I have the following view: > > create or replace view market.p_areas as > select a.* > from _areas a > where a.area in ( > select b.area > from _bins b, _inventories i, _offers o, _pricemembers p > where b.bin = i.bin and > i.inventory = o.inventory and > o.pricegroup = p.pricegroup and > p.buyer in ( > select s.store > from _stores s, _webusers w > where w.webuser = getWebuser() and > w.company = s.company > union > select s.store > from _stores s, _companies c > where s.company = c.company and > c.companyid = 'DEFAULT' > ) > ); ... I failed to report the version: select version(); PostgreSQL 7.4.5 on i686-pc-linux-gnu, compiled by GCC i686-pc-linux-gnu-gcc (GCC) 3.4.0 20040204 (prerelease) Sorry. Mike Mascari