Re: [GENERAL] Fast join - Mailing list pgsql-general

From Leon
Subject Re: [GENERAL] Fast join
Date
Msg-id 377901AE.CCB20316@udmnet.ru
Whole thread Raw
In response to Re: [GENERAL] Fast join  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [GENERAL] Fast join
List pgsql-general
Bruce Momjian wrote:

> >           ->  Index Scan using gindex on btable  (cost=2.05 rows=1 width=4)
> >   ->  Hash  (cost=399.00 rows=10000 width=4)
> >         ->  Seq Scan on btable  (cost=399.00 rows=10000 width=4)
> > -------------
>
> You can't use in index here because an IN is not selective, or if it is,
> there is way for the optimizer to know this.

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?

--
Leon.


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Fast join
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Fast join