Re: Rewriting using rules for performance

Поиск
Список
Период
Сортировка
От Matthew Wakeling
Тема Re: Rewriting using rules for performance
Дата
Msg-id alpine.DEB.2.00.0904031450190.21772@aragorn.flymine.org
обсуждение исходный текст
Ответ на Re: Rewriting using rules for performance  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-performance
On Fri, 3 Apr 2009, Robert Haas wrote:
> On the other hand, the query planner should be figuring out which
> index to use without any help from you.  If it's not, something is
> wrong.

Unfortunately it cannot tell that

SELECT l1.id AS id1, l2.id AS id2 FROM location l1, location l2
WHERE l1.start <= l2.end AND l2.start <= l1.end

is the same as

SELECT l1.id AS id1, l2.id AS id2 FROM location l1, location l2
WHERE bioseg_create(l1.start, l1.end) && bioseg_create(l2.start, l2.end)

which is also the same as

SELECT * from do_overlaps() AS (id1 int, id2 int)

But thanks for clarifying the rule thing for me.

Matthew

--
 The email of the species is more deadly than the mail.

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: plpgsql arrays
Следующее
От: Matthew Wakeling
Дата:
Сообщение: Re: plpgsql arrays