Pedro Alves <pmalves(at)think(dot)pt> writes:
> Is it possible to make a timestamp column use a index in a query like
> select foo from bar where timestamp <= smth?
The planner will do that if it thinks it's appropriate --- which in most
cases it won't. Unless your limit is pretty close to the oldest
timestamp in the table, this query will be quite unselective and so a
seqscan is actually the better way to do it.
If you want to find out whether the planner guessed right, try forcing
it to use an indexscan (via "set enable_seqscan = off"). Compare
regards, tom lane
In response to
pgsql-general by date
|Next:||From: Steven Singer||Date: 2003-03-31 18:23:43|
|Subject: Re: [Pgreplication-general] DBMIRROR and INSERT transactions lose|
|Previous:||From: Joe Conway||Date: 2003-03-31 17:42:26|
|Subject: Re: plpgsql question|