X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9C1463A4290 for ; Sat, 20 Nov 2004 21:51:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56329-07 for ; Sat, 20 Nov 2004 21:51:45 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3D5973A498B for ; Sat, 20 Nov 2004 21:51:45 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id iAKLpZo7000627; Sat, 20 Nov 2004 16:51:35 -0500 (EST) To: "Scott Pederick" Cc: pgsql-sql@postgresql.org Subject: Re: JOIN not being calculated correctly In-reply-to: <000501c4cf49$31c346e0$e1f9f4dc@boblaptop> References: <001e01c4bc14$78cbda90$1d7af0dc@boblaptop> <4187D611.2000109@ca.afilias.info> <000501c4cf49$31c346e0$e1f9f4dc@boblaptop> Comments: In-reply-to "Scott Pederick" message dated "Sun, 21 Nov 2004 08:37:54 +1100" Date: Sat, 20 Nov 2004 16:51:34 -0500 Message-ID: <626.1100987494@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/217 X-Sequence-Number: 19536 "Scott Pederick" writes: > Still can't fathom why it's not using an index scan on the jobs table.. Why exactly do you think that would make it faster? The query evidently requires visiting every single jobs row, so a seqscan seems appropriate to me; indeed I'd say the planner picked exactly the perfect plan. If you think not, try forcing other plan choices and see what happens to the runtime. regards, tom lane