pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Browne <cbbrowne@libertyrms.info>
To: pgsql-sql@postgresql.org
Subject: Re: indexing timestamp fields
Date: Wed, 15 Oct 2003 12:21:48 -0400
Message-ID: <60wub6wjxf.fsf@dev6.int.libertyrms.info> (raw)
References: <bmjqo8$1hve$1@news.hub.org>

teknokrat <teknokrat@yahoo.com> writes:
> Is it a good idea to index timestamp fields? what about date fields in
> general?

If you need to order by a timestamp, then it can be worthwhile.

If that timestamp can be null, and is rarely populated, then you might
get a _big_ benefit from creating a partial index as with:

 create index by_some_date on my_table(some_date) where some_date is
   not null;
-- 
"cbbrowne","@","libertyrms.info"
<http://dev6.int.libertyrms.com/;
Christopher Browne
(416) 646 3304 x124 (land)



view thread (5+ messages)  latest in thread

Message-ID: <60wub6wjxf.fsf@dev6.int.libertyrms.info>
Permalink:  ../60wub6wjxf.fsf@dev6.int.libertyrms.info/
Also on:    postgresql.org/message-id/60wub6wjxf.fsf@dev6.int.libertyrms.info

 · 

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-sql@postgresql.org
  Cc: cbbrowne@libertyrms.info
  Subject: Re: indexing timestamp fields
  In-Reply-To: <60wub6wjxf.fsf@dev6.int.libertyrms.info>

* 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