Re: extra info - curious delay on view/where

From: Markus Schaber <schabios(at)logi-track(dot)com>
To: "andre(dot)toscano" <andre(dot)toscano(at)uol(dot)com(dot)br>
Cc: "pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: extra info - curious delay on view/where
Date: 2004-10-29 17:46:49
Message-ID: 20041029194649.4711e92d@kingfisher.intern.logi-track.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi, Andre,

On Thu, 28 Oct 2004 11:53:25 -0300
"andre.toscano" <andre(dot)toscano(at)uol(dot)com(dot)br> wrote:

> Could an INDEX speed up that SELECT?

> > > CREATE VIEW "stock_available" as
> > > SELECT * FROM stock_details
> > > WHERE available = true AND visible = true AND
> > > location not in (SELECT descr FROM ignored);

Yes, I'm shure.

I would try to create (on the underlying table) a conditional index on
the column "location" with the condition "available = true AND visible =
true".

As often, the acutal effect depends on the count of rows the query
returns compared to the total rows in the table. And it would be helpful
to know the typical queries (especially the rows in the WHERE clauses)
to give additional hints on creating indices. A matching index also
potentially speeds up ORDER BY queries.

HTH,
Markus

--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios(at)logi-track(dot)com | www.logi-track.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2004-10-29 17:57:54 Re: How do you compare (NULL) and (non-NULL)?
Previous Message Wei Weng 2004-10-29 15:59:15 Re: How do you compare (NULL) and (non-NULL)?