date - range

From: "H(dot)J(dot) Sanders" <hjs(at)rmax(dot)nl>
To: <pgsql-performance(at)postgresql(dot)org>
Subject: date - range
Date: 2005-04-01 10:05:44
Message-ID: KIEBKBGIGGNDKKJJNKCFKEPLEEAA.hjs@rmax.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


Anybody a solution for the next problem:

people can subscribe to a service for 1 or more days (upto a max. of 365).

So in the database is stored: first_date and last_date

To select which people are subscribed for a certain date (e.g. today) we use
a select like

select ....... where first_date <= today and last_date >= today

Whatever index we create system always does a sequential scan (which I can
understand).

Has someone a smarter solution?

All suggestions will be welcomed.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mike Rylander 2005-04-01 12:17:56 Re: How to speed up word count in tsearch2?
Previous Message Thomas F.O'Connell 2005-04-01 08:09:50 Re: Follow-Up: How to improve db performance with $7K?