Re: Why search term results different query plan?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Erol ?z <eroloz(at)esg(dot)com(dot)tr>, PostgreSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why search term results different query plan?
Date: 2001-09-30 02:37:24
Message-ID: 211.1001817444@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> I don't really see how you can do any real estimates on %X% type queries,
> although maybe it's assuming longer string => less matches.

More exactly, it's assuming more fixed characters in the pattern ->
less matches; see like_selectivity in src/backend/utils/adt/selfuncs.c.
While the specific numbers it's using are made from whole cloth, I think
the principle should hold good.

I don't see any way to accumulate actual statistics that would improve
the estimate, do you?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-09-30 02:39:34 Re: Encoding passwords
Previous Message Tom Lane 2001-09-30 02:31:44 Re: Why search term results different query plan?