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

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group