Re: Can inherited tables help in this case?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Avi Schwartz <avi(at)CFFtechnologies(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Can inherited tables help in this case?
Date: 2003-06-19 08:35:22
Message-ID: 200306190935.22121.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 19 Jun 2003 6:37 am, Avi Schwartz wrote:
> Hi,
>
> We have a table, lets say of products. Some products get deleted from
> time to time, using a soft delete (i.e. they have a date deleted
> attribute which is set when the the record is deleted. We never
> physically delete the records. Is there a way that table inheritance
> can be used to help us speed up queries?

You might find a partial index to be of use. Something like:

CREATE INDEX my_index ON products (prod_id) WHERE delete_date IS NULL;

--
Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ivar 2003-06-19 08:37:34 Re: How to insert unicode strings ?
Previous Message culley harrelson 2003-06-19 07:52:26 explicit joins vs implicit joins