how to speed query - Mailing list pgsql-general

From T.R.Missner@Level3.com
Subject how to speed query
Date
Msg-id EBFCF3982143D511A77F0008C716807E0106DB03@N0400IDC1.oss.level3.com
Whole thread Raw
Responses Re: how to speed query
List pgsql-general
Hello,

First let me say that I have spent a lot of time reading the archives to try
and get an answer
to my question before I decided to post this.

I have a table that has about 200k rows in it and I am running a simple
query to
get some rows that fall within a range.  the problem i and having is that
the backend is doing
a sequential scan.  Maybe this is the best way for it to do the query but if
that is the case
I need some advice on how to better redesign the system since this simple
query is taking
too long and of course gets longer as the amount of data grows.

Here is a slimmed down example of my table

table sipmsg(

time long,
callid varchar(256)

)

the query simply asks for all callids between 2 times.
I have an index on the time column but it doesn't get used.
Is there a better way for me to be doing this?
Seems so simple.

more info:
the table now has over 200k rows or which the average query will return a
couple of hundred rows.
running on solaris 8 at 433mhz ( i think ) with 1 gig of memory


I know there has to be a way to make this query run faster.

t.r. missner
level(3) communications


pgsql-general by date:

Previous
From: "kingking"
Date:
Subject: Longtime to store large object from Visual Foxpro throught ODBC
Next
From: "chris_five"
Date:
Subject: Re: Blob datatype / image storing