X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 96D52D1B52D for ; Thu, 25 Sep 2003 13:39:20 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 00732-06 for ; Thu, 25 Sep 2003 10:38:53 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 382B3D1B525 for ; Thu, 25 Sep 2003 10:38:49 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8PDcR6c002396; Thu, 25 Sep 2003 09:38:27 -0400 (EDT) To: rigmor.ukuhe@finestmedia.com Cc: "Matt Clark" , pgsql-performance@postgresql.org Subject: Re: Index problem In-reply-to: References: Comments: In-reply-to "Rigmor Ukuhe" message dated "Thu, 25 Sep 2003 13:22:40 +0300" Date: Thu, 25 Sep 2003 09:38:27 -0400 Message-ID: <2395.1064497107@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/318 X-Sequence-Number: 3684 "Rigmor Ukuhe" writes: >>> What causes this behaviour? is there any workaround? Suggestions? At some point the planner is going to decide that one seqscan is cheaper than repeated indexscans. At some point it'll be right ... but in this case it seems its relative cost estimates are off a bit. You might try reducing random_page_cost to bring them more into line with reality. (But keep in mind that the reality you are measuring appears to be small-table-already-fully-cached reality. On a large table you might find that small random_page_cost isn't such a hot idea after all.) regards, tom lane