Skip site navigation (1) Skip section navigation (2)

indexed column but queries still slow

From: Amir Zicherman <amir(dot)zicherman(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: indexed column but queries still slow
Date: 2004-08-17 21:06:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

i have a btree index on col1 in table1.  The column has either values
1,2,3, or 4.  4 does not appear that much in the table (only 5 times).
 there are about 20 million rows in the table.  when i do a "select *
from table1 where col1=4" it takes very long time to get back to me
(around 4 minutes).  why is it taking so long if i have an index on
it?  I also tried this with a hash index and it was still slow.

thanx, amir


pgsql-novice by date

Next:From: Gaetano MendolaDate: 2004-08-17 23:28:29
Subject: Re: indexed column but queries still slow
Previous:From: Tom LaneDate: 2004-08-17 19:48:47
Subject: Re: pg_attribute has way too many row versions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group