Re: Wrong plan sequential scan instead of an index one

From: Richard Huxton <dev(at)archonet(dot)com>
To: Gaetano Mendola <gmendola(at)mbigroup(dot)it>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Wrong plan sequential scan instead of an index one
Date: 2007-03-30 11:48:18
Message-ID: 460CF902.4020707@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Dimitri 2007-03-30 13:14:35 Re: Shared buffers, db transactions commited, and write IO on Solaris
Previous Message Gaetano Mendola 2007-03-30 11:35:00 Re: Wrong plan sequential scan instead of an index one