Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id AFAE789E972 for ; Wed, 15 Feb 2012 19:11:40 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rxo0j-0004o5-0K for pgsql-performance@postgresql.org; Wed, 15 Feb 2012 23:11:41 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q1FNBKnq024346; Wed, 15 Feb 2012 18:11:20 -0500 (EST) To: Markus Innerebner cc: pgsql-performance@postgresql.org Subject: Re: Optimizer is not choosing index In-reply-to: References: Comments: In-reply-to Markus Innerebner message dated "Wed, 15 Feb 2012 23:40:13 +0100" Date: Wed, 15 Feb 2012 18:11:20 -0500 Message-ID: <24345.1329347480@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/123 X-Sequence-Number: 46295 Markus Innerebner writes: > The query plan says, that a sequential scan is performed on the edge table. I consider it strange that he is not accessing on the (btree) index one the edge table. This suggests that you have a datatype mismatch: > " Hash Cond: ((e.target)::numeric = n.id)" Your index is presumably on e.target, not e.target::numeric, so it's not applicable. Try to make the join columns the same datatype. regards, tom lane