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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to