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

From Tom Lane
Subject Re: Problem (bug?) with like
Date
Msg-id 13305.1007394045@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem (bug?) with like  (bombadil@wanadoo.es)
Responses Re: Problem (bug?) with like
List pgsql-general
bombadil@wanadoo.es writes:
>  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.

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

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 :-(

            regards, tom lane

pgsql-general by date:

Previous
From: Fran Fabrizio
Date:
Subject: Determining current database programmatically
Next
From: Tom Lane
Date:
Subject: Re: Determining current database programmatically