From: andre.toscano <andre.toscano@uol.com.br>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: extra info - curious delay on view/where
Date: Thu, 28 Oct 2004 11:53:25 -0300
Message-ID: <I6AUP1$D20A31AD6BA04587AF2C81E6DEC05C48@uol.com.br> (raw)
Hi Folks,
It´s just for curiosity I ask:
Could an INDEX speed up that SELECT?
Thanks in advance, and sorry for my newbies questions.
André
(Brazilian User)
> 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
>
>
> ---------------------------(end of broadcast)---------------
------------
> TIP 9: the planner will ignore your desire to choose an
index scan if your
> joining column's datatypes do not match
>
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: andre.toscano@uol.com.br
Subject: Re: extra info - curious delay on view/where
In-Reply-To: <I6AUP1$D20A31AD6BA04587AF2C81E6DEC05C48@uol.com.br>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox