Re: Wrong plan sequential scan instead of an index one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux