From: Markus Schaber <schabios@logi-track.com>
To: andre.toscano <andre.toscano@uol.com.br>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: extra info - curious delay on view/where
Date: Fri, 29 Oct 2004 19:46:49 +0200
Message-ID: <20041029194649.4711e92d@kingfisher.intern.logi-track.com> (raw)
In-Reply-To: <I6AUP1$D20A31AD6BA04587AF2C81E6DEC05C48@uol.com.br>
References: <I6AUP1$D20A31AD6BA04587AF2C81E6DEC05C48@uol.com.br>
Hi, Andre,
On Thu, 28 Oct 2004 11:53:25 -0300
"andre.toscano" <andre.toscano@uol.com.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@logi-track.com | www.logi-track.com
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: schabios@logi-track.com, andre.toscano@uol.com.br
Subject: Re: extra info - curious delay on view/where
In-Reply-To: <20041029194649.4711e92d@kingfisher.intern.logi-track.com>
* 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