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 A33913A62A9 for ; Fri, 28 Jan 2005 21:34:33 +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 07166-03 for ; Fri, 28 Jan 2005 21:34:29 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 189E53A62D5 for ; Fri, 28 Jan 2005 21:34:28 +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 j0SLYPIQ026389; Fri, 28 Jan 2005 16:34:25 -0500 (EST) To: Pallav Kalva Cc: PERFORM Subject: Re: Poor Performance on Postgres 8.0 In-reply-to: <41FAA76B.7070704@deg.cc> References: <41FA5726.7040502@deg.cc> <2581.1106929396@sss.pgh.pa.us> <41FA6F29.9060009@deg.cc> <8990.1106931750@sss.pgh.pa.us> <41FA8697.1030200@deg.cc> <22896.1106941715@sss.pgh.pa.us> <41FA992B.2090405@deg.cc> <25930.1106945442@sss.pgh.pa.us> <41FAA76B.7070704@deg.cc> Comments: In-reply-to Pallav Kalva message dated "Fri, 28 Jan 2005 15:58:19 -0500" Date: Fri, 28 Jan 2005 16:34:24 -0500 Message-ID: <26388.1106948064@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: 200501/600 X-Sequence-Number: 10290 Pallav Kalva writes: > On 8 > common | attribute | fknamestringid | 0 | 4 > | 80 | {2524,2434,2530,2522,2525,2523,2527,2526,2574,2531} | > {0.219333,0.199333,0.076,0.0643333,0.0616667,0.05,0.0453333,0.042,0.04,0.0286667} > | {2437,2528,2529,2538,2539,2540,2554,2562,2575,2584,2637} | 0.0274016 Given those stats, the planner is going to estimate that about 1/80th of the attribute table matches any particular fknamestringid, and that's what's driving it away from using the indexscan. I cannot tell whether there are indeed a couple of thousand rows joining to the 'squareFeet' string row (in which case the condition numericValue='775.0' must be really selective) or whether this is an outlier case that joins to just a few attribute rows. The slightly different stats values for 7.4 would have given it a slightly lower value for the cost of an indexscan by idx_attribute_fknamestringid, but certainly not as low as your original message shows. Perhaps you have some difference in parameter settings in your 7.4 installation --- most likely a lower random_page_cost. regards, tom lane