X-Original-To: pgsql-performance@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 1AF1A924F3C for ; Tue, 20 May 2003 10:04:32 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 61900-03 for ; Tue, 20 May 2003 10:04:25 -0400 (EDT) Received: from shield.nordlb.lv (shield.pirmabanka.lv [195.114.57.4]) by developer.postgresql.org (Postfix) with ESMTP id C92C0924F44 for ; Tue, 20 May 2003 10:04:22 -0400 (EDT) Received: from wall2.pirmabanka.lv (wall2-pub.nordlb.lv [195.114.57.14]) by shield.nordlb.lv (8.12.9/8.12.9) with SMTP id h4KE4Kbg023360 for ; Tue, 20 May 2003 17:04:20 +0300 Received: from share.nordlb.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Tue, 20 May 2003 17:04:19 +0300 (EET DST) Received: from pc311x1.nordlb.lv (localhost.localdomain [127.0.0.1]) by nordlb.lv (8.11.6/8.11.6) with SMTP id h4KE4HN18112 for ; Tue, 20 May 2003 17:04:19 +0300 Received: (qmail 4269 invoked by uid 100); 20 May 2003 14:07:13 -0000 Date: Tue, 20 May 2003 17:07:13 +0300 From: Victor Yegorov To: Eugene Fokin Cc: pgsql-performance@postgresql.org Subject: Re: 7.3.2 vs 7.1.2 Message-ID: <20030520140713.GN1976@nordlb.lv> References: <20030520122838.GA28654@solvo.ru> <20030520130913.GM1976@nordlb.lv> <20030520132842.GA29262@solvo.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20030520132842.GA29262@solvo.ru> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/194 X-Sequence-Number: 1973 * Eugene Fokin [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.13 rows=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.13 rows=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.76 rows=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.84 rows=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