Re: Joins on many-to-many relations.

Поиск
Список
Период
Сортировка
От Rodrigo De León
Тема Re: Joins on many-to-many relations.
Дата
Msg-id a55915760703150705j3b4c2b3esd94d4a27d31ee658@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Joins on many-to-many relations.  (Wiebe Cazemier <halfgaar@gmx.net>)
Список pgsql-sql
On 3/14/07, Wiebe Cazemier <halfgaar@gmx.net> wrote:
> I discovered that removing the subselect (the entire second condition of
> the join actually) is not the only thing that speeds it up. If I remove
> the LIKE check on account.description, it's also a lot faster (152 ms
> as opposed to 2915 ms), although not as fast as without the subselect.
> I don't understand why that makes such a big difference. There is an
> index on upper() on the field.

From http://www.postgresql.org/docs/8.2/static/indexes-types.html :

"The optimizer can also use a B-tree index for queries involving the
pattern matching operators LIKE and ~ if the pattern is a constant and
is anchored to the beginning of the string — for example, col LIKE
'foo%' or col ~ '^foo', but not col LIKE '%bar'."


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Alter Table
Следующее
От: Wiebe Cazemier
Дата:
Сообщение: Re: Joins on many-to-many relations.