Re: Indexing question

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Alexander Priem" <ap(at)cict(dot)nl>, "Tomasz Myrta" <jasiek(at)klaster(dot)net>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Indexing question
Date: 2003-08-29 08:14:04
Message-ID: 0be001c36e05$83034fb0$2800a8c0@mars
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


> So if I understand correctly I could ditch the 'deleted' field entirely
and
> use just the 'deleteddate' field. This 'deleteddate' field would be NULL
by
> default. It would contain a date value if the record is considered
> 'deleted'.
>
> The index would be 'create index a on tablename(deleteddate) where
> deleteddate is null'.
>
> I could then access 'current' records with a view like 'create view x_view
> as select * from tablename where deleteddate is null'.
>
> Is that correct? This would be the best performing solution for this kind
of
> thing, I think (theoretically at least)?

Yes, I think it would be best. Definitely better than your current
solution.

Cheers,

Chris

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-08-29 08:15:05 Re: bad estimates
Previous Message Ken Geis 2003-08-29 08:10:06 Re: bad estimates