X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 97BBA310A9C for ; Tue, 1 Jul 2003 13:43:04 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 67864-06 for ; Tue, 1 Jul 2003 10:42:54 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 73DBD310A9E for ; Tue, 1 Jul 2003 10:42:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h61DgrQQ002501; Tue, 1 Jul 2003 09:42:54 -0400 (EDT) To: Toby Sargeant Cc: pgsql-performance@postgresql.org Subject: Re: excessive disk access during query In-reply-to: <20030701031919.GC30242@wehi.edu.au> References: <20030701031919.GC30242@wehi.edu.au> Comments: In-reply-to Toby Sargeant message dated "Tue, 01 Jul 2003 13:19:23 +1000" Date: Tue, 01 Jul 2003 09:42:53 -0400 Message-ID: <2500.1057066973@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200307/13 X-Sequence-Number: 2306 Toby Sargeant writes: > Merge Join (cost=0.00..448139.41 rows=14786 width=52) (actual time=1582.24..125624.92 rows=2140 loops=1) > Merge Cond: ("outer".seq_text_id = "inner".id) > -> Index Scan using seq_text_map_seq_text_index on seq_text_map (cost=0.00..154974.74 rows=2957158 width=48) (actual time=23.04..110877.65 rows=2956147 loops=1) > -> Index Scan using seq_text_pkey on seq_text (cost=0.00..285540.03 rows=17174 width=4) (actual time=71.51..12260.38 rows=3077 loops=1) > Filter: (lower(text) ~~ '%porin%'::text) > Total runtime: 125627.45 msec I'm surprised it doesn't try to use a hash join instead. Are the datatypes of seq_text_id and id different (if so, can you make them the same?) What sorts of plans and timings do you get if you flip enable_mergejoin and/or enable_indexscan? regards, tom lane