Re: extra info - curious delay on view/where

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: extra info - curious delay on view/where
Date: 2004-10-28 10:42:46
Message-ID: 200410281142.46266.gary.stainburn@ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thursday 28 October 2004 11:16 am, Gary Stainburn wrote:
> Hi folks.
>
> I have the following view:
>
> CREATE VIEW "stock_available" as
> SELECT * FROM stock_details
> WHERE available = true AND visible = true AND
> location not in (SELECT descr FROM ignored);
>
> Stock_details is itself a view pulling in a number of tables.
> Everything works fine until I try to pull in only the details for a
> specific branch, using the following.
>
> select * from stock_available where branch = 'Leeds';
> or
> select * from stock_available where branch = 'Doncaster';
>
> At this point, the query takes 11 seconds. Any other quiery,
> including
[snip]

Once thing I forgot to mention. If I run the above on the base view
stock_details, it returns in < 1 second too.
--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-10-28 14:22:47 Re: Select Instead on a table
Previous Message Gary Stainburn 2004-10-28 10:16:44 curious delay on view/where