Re: 7.3.2 vs 7.1.2 - Mailing list pgsql-performance

From Victor Yegorov
Subject Re: 7.3.2 vs 7.1.2
Date
Msg-id 20030520140713.GN1976@nordlb.lv
Whole thread Raw
In response to Re: 7.3.2 vs 7.1.2  (Eugene Fokin <elf@solvo.ru>)
Responses Re: 7.3.2 vs 7.1.2
Re: 7.3.2 vs 7.1.2
Re: 7.3.2 vs 7.1.2
List pgsql-performance
* Eugene Fokin <elf@solvo.ru> [20.05.2003 16:33]:
> 7.2.1:
> ->  Merge Join  (cost=0.00..19885.60 rows=147281 width=8) (actual time=0.08..2059.89 rows=147281 loops=1)
>   ->  Index Scan using load_rcn_id_idx on loads l  (cost=0.00..17026.36 rows=147281 width=4) (actual
time=0.04..786.13rows=147281 loops=1) 
>   ->  Index Scan using rcn_detail_idx on rcn_details  (cost=0.00..618.30 rows=12692 width=4) (actual
time=0.03..510.13rows=151332 loops=1) 

snip

> 7.3.2:
> ->  Merge Join  (cost=0.00..19524.78 rows=147281 width=189) (actual time=0.14..9419.68 rows=147281 loops=1)
>   Merge Cond: ("outer".rcn_id = "inner".id)
>     ->  Index Scan using load_rcn_id_idx on loads l  (cost=0.00..16659.18 rows=147281 width=181) (actual
time=0.07..4486.76rows=147281 loops=1) 
>     ->  Index Scan using rcn_detail_idx on rcn_details  (cost=0.00..624.96 rows=12692 width=8) (actual
time=0.02..587.84rows=151332 loops=1) 

As you can see, in 7.2.1 index scan on loads (load_rcn_id_idx) takes 0.04..786.13,
but in 7.3.2 - 0.07..4486.76.

Also, note the difference in the:

7.2.1 "... rows=147281 width=4) ..."
7.3.2 "... rows=147281 width=181) ..."

My guesses:

1. Check your index.
2. Do vacuum analyze again.
3. This part:
(loads l JOIN (SELECT rcn_details.id, rcn_details.date_pour FROM rcn_details) r ON ((r.id = l.rcn_id)))

Why do you use subselect here? It seems to me, that you can simply join
whole table, can't you?

May be somebody else will point to some other details.
Good luck!

--

Victor Yegorov

pgsql-performance by date:

Previous
From: Eugene Fokin
Date:
Subject: Re: 7.3.2 vs 7.1.2
Next
From: Tom Lane
Date:
Subject: Re: nested select query failing