Skip site navigation (1) Skip section navigation (2)

best index for timestamp field null and not null queries

From: Jeremy Wells <jemmyw(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: best index for timestamp field null and not null queries
Date: 2012-08-26 07:08:36
Message-ID: B3A5A722BF4D475FAB548FB93409C50E@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi, I've got a database table with a datetime column "deleted_at". I'll be running lots of queries against the table but they'll all be of the nature "deleted_at IS NULL" and "deleted_at IS NOT NULL". 

What's the best index to place on this column? I assume if I add just a straight index then it'll index all of the values that go into it. 

Responses

pgsql-novice by date

Next:From: Gavin FlowerDate: 2012-08-26 09:35:29
Subject: Re: best index for timestamp field null and not null queries
Previous:From: Prima ChairunnandaDate: 2012-08-25 19:33:11
Subject: Re: Hot Standby Lagging Behind

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group