Re: Problem (bug?) with like - Mailing list pgsql-general

From bombadil@wanadoo.es
Subject Re: Problem (bug?) with like
Date
Msg-id 20011203193033.A480@lorien.net
Whole thread Raw
In response to Re: Problem (bug?) with like  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
El lunes 03 de diciembre, Tom Lane escribió:
> >  Here are my queries:
>
> You sure you didn't paste in the same result for #2 and #3?  They're
> the same plan with the same rows estimates --- but I'd expect the rows
> estimates, at least, to change given the more-selective LIKE pattern.

 I don't know for sure if I have send wrong data, but I think not.
 Tomorrow I'll get more info.

> Also, how many rows are there really that match '%DA%' and '%DAVID%'?

 Very few for that incredible difference in time:

     '%DA%'        -> 2 sec.
    '%DAVID%'     -> 3 min.

> I suspect the planner is being overoptimistic about the selectivity of
> '%DAVID%', and is choosing a plan that doesn't work well when there are
> lots of DAVIDs :-(

 I have thought that it only occurs when item to find is present
 completely in any number of registers, but this is only a burde
 hypothesis :?

 Thanks for all.

                             David


pgsql-general by date:

Previous
From: "Yuri A. Kabaenkov"
Date:
Subject: Re: interval
Next
From: Tom Lane
Date:
Subject: Re: Problem (bug?) with like