Re: Indexed views?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Indexed views?
Дата
Msg-id 24334.1094524810@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Indexed views?  (Tiago Wright <tiagowright@gmail.com>)
Ответы Re: Indexed views?  (Tiago Wright <tiagowright@gmail.com>)
Список pgsql-hackers
Tiago Wright <tiagowright@gmail.com> writes:
> For example, consider the view
> CREATE VIEW vw_lot AS
> �SELECT�productid,�lotid,�parentlotid,�lottype,�lotname,�productname
> ���FROM�lot
> NATURAL�JOIN�product;

> where productname is in the product table, and lotname in the lot
> table. I would be interested in creating an index such as

> CREATE INDEX ix_vw_lot ON vw_lot (lotname, productname);

What purpose would this serve that indexes on the separate tables
wouldn't serve?

> The index would be enough to cover 90% of the queries against
> lot the lot and inventory tables.

This sounds to me like you are suffering from a common misconception.
Postgres cannot answer queries from the contents of indexes alone.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tiago Wright
Дата:
Сообщение: Re: Indexed views?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Breakage in trigger.c