how to speed query

From: T(dot)R(dot)Missner(at)Level3(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: how to speed query
Date: 2001-09-14 20:05:18
Message-ID: EBFCF3982143D511A77F0008C716807E0106DB03@N0400IDC1.oss.level3.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martín Marqués 2001-09-14 20:05:41 chunk size problem
Previous Message Stephan Szabo 2001-09-14 20:00:02 Re: returning value from inside a transaction