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