Re: indexed column not working as fast as expected

From: "Glen Parker" <glenebob(at)nwlink(dot)com>
To: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: indexed column not working as fast as expected
Date: 2004-08-17 23:32:11
Message-ID: AJEKKAIECKNMBCEKADJPMENFCMAA.glenebob@nwlink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Did you do an explain? I'd guess the index isn't being used because of
skewed statistics.

> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2004-08-17 23:56:08 Re: indexed column not working as fast as expected
Previous Message Dann Corbit 2004-08-17 23:26:45 Re: Fw: libpq or Embedded SQL in C