pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pallav Kalva <pkalva@deg.cc>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PERFORM <pgsql-performance@postgresql.org>
Subject: Re: Poor Performance on Postgres 8.0
Date: Fri, 28 Jan 2005 14:57:31 -0500
Message-ID: <41FA992B.2090405@deg.cc> (raw)
In-Reply-To: <22896.1106941715@sss.pgh.pa.us>
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>

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 <pkalva@deg.cc> 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
>
>  
>





view thread (11+ messages)  latest in thread

Message-ID: <41FA992B.2090405@deg.cc>
Permalink:  ../41FA992B.2090405@deg.cc/
Also on:    postgresql.org/message-id/41FA992B.2090405@deg.cc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pkalva@deg.cc, tgl@sss.pgh.pa.us
  Subject: Re: Poor Performance on Postgres 8.0
  In-Reply-To: <41FA992B.2090405@deg.cc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox