pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Alexander Priem <ap@cict.nl>
To: Tomasz Myrta <jasiek@klaster.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Indexing question
Date: Fri, 29 Aug 2003 16:14:04 +0800
Message-ID: <0be001c36e05$83034fb0$2800a8c0@mars> (raw)
References: <012f01c36dfa$0f4a8760$b696a8c0@APR>
	<3F4EFAB6.7030104@klaster.net>
	<015f01c36e02$134fe960$b696a8c0@APR>


> 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




view thread (15+ messages)  latest in thread

Message-ID: <0be001c36e05$83034fb0$2800a8c0@mars>
Permalink:  ../0be001c36e05$83034fb0$2800a8c0@mars/
Also on:    postgresql.org/message-id/0be001c36e05$83034fb0$2800a8c0@mars

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: chriskl@familyhealth.com.au, ap@cict.nl, jasiek@klaster.net
  Subject: Re: Indexing question
  In-Reply-To: <0be001c36e05$83034fb0$2800a8c0@mars>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox