Re: Problem (bug?) with like

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: drheart(at)wanadoo(dot)es
Cc: Lista PostgreSql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem (bug?) with like
Date: 2001-12-03 18:31:23
Message-ID: 20011203193123.B480@lorien.net
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 Tim Barnard 2001-12-03 18:35:26 Re: libpq Newbie question
Previous Message bombadil 2001-12-03 18:30:33 Re: Problem (bug?) with like

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-12-03 18:32:15 Re: case sensititvity bug in foreign keys on cygwin
Previous Message bombadil 2001-12-03 18:30:33 Re: Problem (bug?) with like