Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Wrong plan sequential scan instead of an index one



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group