timestamped archive data index searches

From: "Stephen Birch" <sgbirch(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: timestamped archive data index searches
Date: 2002-07-16 16:31:51
Message-ID: F1422fYOFTJ3KHjlAOg00009d10@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I know that the question of forcing PostgreSQL to use an index during search
ops is an FAQ and have worked with each of the suggested solutions to no
avail.

From the nature of those questions, it looks like the problem I have to
solve is common and unsolved. I am using the database to archive data
arriving at a rate of about 100 records a minute, the old data needs to be
stored hence the use of a database. Each record is timestamped as it is
inserted in the database.

The system needs a web site that can display data from (say) the last hour
of data.

Now, when the database is searched using a select on the timestamp it never
uses the index on that field no matter how I set the db params. I think
that the query optimizer is noticing the sequential nature of the timestamp
field and assuming that an index will always slow the query.

The problem is that the retrieval of the past hour's data has to scan the
entire database and so is very, very slow.

Any ideas?

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-07-16 16:32:08 Re: Disabling case sensitivity
Previous Message Johnson, Shaunn 2002-07-16 16:30:55 integer out of range errors