question about indexing.

From: "Brian Hirt" <bhirt(at)berkhirt(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Cc: "Brian A Hirt" <bhirt(at)berkhirt(dot)com>
Subject: question about indexing.
Date: 2001-09-30 23:16:36
Message-ID: 001e01c14a05$f533f740$640b0a0a@berkhirt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table with about 1 million rows in it. One of the columns in this
table is some sort of status (it's an int2). Out of the million rows, only
about 100 of the rows have a status that is not like the rest.

for example:
999,900 have the value 1
23 have the value 2
67 have the value 3
10 have the value 4

I often want to fetch the rows within that subset of 100. When i index this
column, the planner always seems to choose a table scan when i query it.
I've tried BTREE and HASH indexes and both do the same thing.

Yes, i do vacuum the table.

Does anyone know how to avoid all these table scans?

Thanks,

Brian

Browse pgsql-general by date

  From Date Subject
Next Message Brian Hirt 2001-09-30 23:32:26 question about indexing.
Previous Message Your Name 2001-09-30 23:01:53 PostgreSQL: T oUse Or Not To Use?