Re: Problem (bug?) with like

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bombadil(at)wanadoo(dot)es
Cc: Lista PostgreSql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem (bug?) with like
Date: 2001-12-03 15:40:45
Message-ID: 13305.1007394045@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

bombadil(at)wanadoo(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-12-03 15:46:31 Re: Determining current database programmatically
Previous Message Steve Brett 2001-12-03 15:36:40 Re: When do I Vacuum ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-12-03 15:53:53 Re: My machine is down
Previous Message bombadil 2001-12-03 15:08:59 Re: Problem (bug?) with like