X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CE5A052AA2 for ; Tue, 29 Mar 2005 15:41:05 +0100 (BST) 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 69457-05 for ; Tue, 29 Mar 2005 14:41:03 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E9DC75364E for ; Tue, 29 Mar 2005 15:41:02 +0100 (BST) 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 j2TEevMk021462; Tue, 29 Mar 2005 09:40:57 -0500 (EST) To: Simon Riggs Cc: Karim A Nassar , Stephan Szabo , Christopher Kings-Lynne , pgsql-performance@postgresql.org Subject: Re: Delete query takes exorbitant amount of time In-reply-to: <1112095776.11750.958.camel@localhost.localdomain> References: <1112095776.11750.958.camel@localhost.localdomain> Comments: In-reply-to Simon Riggs message dated "Tue, 29 Mar 2005 12:29:36 +0100" Date: Tue, 29 Mar 2005 09:40:57 -0500 Message-ID: <21461.1112107257@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/630 X-Sequence-Number: 11335 Simon Riggs writes: > ...but, I see no way for OidFunctionCall8 to ever return an answer of > "always just 1 row, no matter how big the relation"...so tuples_fetched > is always proportional to the size of the relation. Are unique indexes > treated just as very-low-selectivity indexes? Yeah. It is not the job of amcostestimate to estimate the number of rows, only the index access cost. (IIRC there is someplace in the planner that explicitly considers unique indexes as a part of developing selectivity estimates ... but it's not that part.) regards, tom lane