X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 531BECCA94 for ; Thu, 17 Jul 2003 18:02:49 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 86440-05 for ; Thu, 17 Jul 2003 18:03:07 +0000 (GMT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id EFBB3CCA41 for ; Thu, 17 Jul 2003 15:02:37 -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 h6HI30Q3005495; Thu, 17 Jul 2003 14:03:00 -0400 (EDT) To: Paul Thomas Cc: Fabian Kreitner , "pgsql-performance @ postgresql . org" Subject: Re: index / sequential scan problem In-reply-to: <20030717153825.C27991@bacon> References: <5.1.0.14.0.20030717131157.03957fa0@195.145.148.245> <5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245> <5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245> <20030717111248.C27264@bacon> <5.1.0.14.0.20030717131157.03957fa0@195.145.148.245> <20030717133445.A27991@bacon> <5.1.0.14.0.20030717144625.039c4a10@195.145.148.245> <20030717153825.C27991@bacon> Comments: In-reply-to Paul Thomas message dated "Thu, 17 Jul 2003 15:38:25 +0100" Date: Thu, 17 Jul 2003 14:03:00 -0400 Message-ID: <5494.1058464980@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/271 X-Sequence-Number: 2564 Paul Thomas writes: > 2) enable_seqscan = false >> Seq Scan on notiz_objekt a (cost=100000000.00..100111719.36 rows=15561 >> width=12) (actual time=0.25..535.75 rows=31122 loops=1) > I've just noticed this. Something is not right here. Look at the crazy > cost estimation for the second query. No, that's exactly what it's supposed to do. enable_seqscan cannot simply suppress generation of a seqscan plan (because that might be the only way to do the query, if there's no applicable index). So it generates the plan, but sticks a large penalty into the cost estimate to keep the planner from choosing that alternative if there is any other. The "100000000.00" is that artificial penalty. We could probably hide this implementation detail from you if we tried hard enough, but it hasn't bothered anyone enough to try. regards, tom lane