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 E05923A60E3 for ; Fri, 28 Jan 2005 19:57:44 +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 94642-09 for ; Fri, 28 Jan 2005 19:57:33 +0000 (GMT) Received: from mail.deg.cc (mail.deg.cc [64.139.134.201]) by svr1.postgresql.org (Postfix) with ESMTP id CCFF53A6099 for ; Fri, 28 Jan 2005 19:57:33 +0000 (GMT) Received: from deg.cc (kyle.deg.cc [198.70.16.205]) by mail.deg.cc (Postfix) with ESMTP id 5284E5610F; Fri, 28 Jan 2005 14:57:28 -0500 (EST) Message-ID: <41FA992B.2090405@deg.cc> Date: Fri, 28 Jan 2005 14:57:31 -0500 From: Pallav Kalva User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: PERFORM Subject: Re: Poor Performance on Postgres 8.0 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> In-Reply-To: <22896.1106941715@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/593 X-Sequence-Number: 10283 explain analyze select * from common.string text1_ where text1_.value='squareFeet'; QUERY PLAN -------------------------------------------------------------------------------------------------------- Seq Scan on string text1_ (cost=0.00..4.41 rows=1 width=21) (actual time=0.283..0.322 rows=1 loops=1) Filter: (value = 'squareFeet'::text) Total runtime: 0.492 ms I am not worried about this table as common.string has only 190 records, where as the other table common.attribute which is very big (200k records) i want it to use index scan on it . The matching column in common.attribute table has only 175 distinct records in common.attribute table , do you think that's the problem ? here is the full query again select attribute0_.attributeid as attribut1_, attribute0_.stringvalue as stringva2_, attribute0_.bigStringvalue as bigStrin3_, attribute0_.integervalue as integerv4_, attribute0_.numericvalue as numericv5_, attribute0_.datevalue as datevalue, attribute0_.booleanvalue as booleanv7_, attribute0_.fknamestringid as fknamest8_ from common.attribute attribute0_, common.string text1_ where (text1_.value='squareFeet' and attribute0_.fknamestringid=text1_.stringid) and (numericValue='775.0') Tom Lane wrote: >Pallav Kalva writes: > > >>still doesnt make use of the index on common.attribute table . >> >> > >What do you get from just plain > >explain analyze select * from common.string text1_ >where text1_.value='squareFeet'; > >I get the impression that it must think this will yield a lot of rows. > > regards, tom lane > > >