index not used?

From: Dan Pelleg <daniel+pgsql(at)pelleg(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: index not used?
Date: 2004-10-20 14:06:09
Message-ID: 16758.28881.684597.807409@lark.auton.cs.cmu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm trying to access a table with about 120M rows. It's a vertical version
of a table with 360 or so columns. The new columns are: original item col,
original item row, and the value.

I created an index:

CREATE INDEX idx on table (col, row)

however, selects are still very slow. It seems it still needs a sequential
scan:

EXPLAIN SELECT * FROM table WHERE col=1 AND row=10;
QUERY PLAN
------------------------------------------------------------------------------
Seq Scan on table (cost=100000000.00..102612533.00 rows=1 width=14)
Filter: ((col = 1) AND ("row" = 10))

What am I doing wrong?

--
Dan Pelleg

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-20 14:15:51 Re: Database Disappeared
Previous Message Josh Close 2004-10-20 13:25:22 Re: how much ram do i give postgres?