Re: Why search term results different query plan? - Mailing list pgsql-general

From Tom Lane
Subject Re: Why search term results different query plan?
Date
Msg-id 211.1001817444@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why search term results different query plan?  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Why search term results different query plan?
List pgsql-general
Martijn van Oosterhout <kleptog@svana.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why search term results different query plan?
Next
From: Tom Lane
Date:
Subject: Re: Encoding passwords