Re: LIKE optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: LIKE optimization
Дата
Msg-id 12925.979667493@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: LIKE optimization  (Nabil Sayegh <nsmail@sayegh.de>)
Список pgsql-novice
Nabil Sayegh <nsmail@sayegh.de> writes:
> However, shouldn't "LIKE '%'" be ALWAYS ignored no matter how the
> database is structured?

It's a no-op at runtime, sure, but the planner does not know enough
about LIKE to realize that (at least not in the default 7.0.* setup;
you might want to look at contrib/likeplanning).

I'm guessing that the presence of the LIKE clauses is altering the
planner's row count estimates enough to change the plan it picks.
This is only a guess, however, since you still haven't shown us the
EXPLAIN results.  It's also very unclear whether or not you have done
a VACUUM ANALYZE --- without that, the planner is pretty much flying
blind.

            regards, tom lane

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

Предыдущее
От: Nabil Sayegh
Дата:
Сообщение: Re: LIKE optimization
Следующее
От: "rob"
Дата:
Сообщение: Re: LIKE optimization