Re: bad join performance

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: bad join performance
Дата
Msg-id 20030818104119.C30675-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на bad join performance  (pginfo <pginfo@t1.unisoftbg.com>)
Список pgsql-performance
On Mon, 18 Aug 2003, pginfo wrote:

> Hi ,
> I am using pg 7.3.3 on RH 7.3,
> dual Athlon
> 1 GB RAM.
>
> I have 2 tables a_acc and a_vid_doc (all PK are int).
>
> sizes:
>
>  select count(IDS) from a_acc;
>   count
> ---------
>  1006772
>
> select count(IDS) from a_vid_doc;
>  count
> -------
>     25
>
> I have problem with the join ot this tables.
> I tryed this examples:
>
>  explain analyze select G.IDS  from A_ACC G   join A_VID_DOC VD
> ON(G.IDS_VID_DOC=VD.IDS)  WHERE G.IDS = 1338673 ;

In general the best index on A_ACC for this kind of query might
be on on A_ACC(IDS, IDS_VID_DOC).  That should allow you to search
by IDS value but still get a sorted order of IDS_VID_DOC to help
the join.


В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bad join performance
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Insert performance