Re: Wrong plan sequential scan instead of an index one

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Wrong plan sequential scan instead of an index one
Дата
Msg-id 460CF902.4020707@archonet.com
обсуждение исходный текст
Ответ на Wrong plan sequential scan instead of an index one  (Gaetano Mendola <mendola@bigfoot.com>)
Ответы Re: Wrong plan sequential scan instead of an index one
Список pgsql-performance
Gaetano Mendola wrote:
>
> The match 19 for '%pi%' is estimated, the real matches are:
>
> test=# select id from l_pvcp where value ilike '%pi%';
>  id
> - ----
>  62
> (1 row)
>
>
> test=#  select id from l_pvcp where value ilike 'pi';
>  id
> - ----
>  62
> (1 row)
>
> so one row in both cases, that's why I expect for both same plan.

Ah, but it's got no way of knowing what matches you'll get for
'%anything%'. There's no easy way to get statistics for matching substrings.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: Wrong plan sequential scan instead of an index one
Следующее
От: Dimitri
Дата:
Сообщение: Re: Shared buffers, db transactions commited, and write IO on Solaris