Bruce Momjian wrote:
>
> > Ok. It seems that statistics which is within optimizer's reach is quite
> > poor, so optimizer can't always make sane predictions. And, I am
> > afraid, improving statistics gathering will require major rewrite of code.
> >
> > So there should at least be some way to give hints to optimizer,
> > shouldn't it?
>
> Currently, no way to give hints.
Picture this:
SELECT * FROM atable,btable WHERE
atable.cfield = btable.cfield AND #(atable.afield>10)#
Where "magic brackets" will tell optimizer that qualification
atable.afield>10 is very restrictive and should be treated on a par
with "=" qualification. Such hint seems much easier to realize
than to make optimizer gather real statistics on a table during
decision process.
--
Leon.