X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E59D3D1B4E1 for ; Wed, 15 Oct 2003 17:13:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 96568-04 for ; Wed, 15 Oct 2003 14:12:30 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 64974D1B53C for ; Wed, 15 Oct 2003 14:12:29 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h9FHCSNu004442 for ; Wed, 15 Oct 2003 17:12:28 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h9FHA2VQ004241 for pgsql-sql@postgresql.org; Wed, 15 Oct 2003 17:10:02 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: indexing timestamp fields Date: Wed, 15 Oct 2003 12:21:48 -0400 Organization: Hub.Org Networking Services Lines: 16 Message-ID: <60wub6wjxf.fsf@dev6.int.libertyrms.info> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:n2snrlp7AV5trEHNlDe95HsvjL4= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/178 X-Sequence-Number: 15578 teknokrat 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" Christopher Browne (416) 646 3304 x124 (land)