On Sun, Aug 29, 2004 at 11:04:48AM -0700, Mr Pink wrote: > Another is that if the condition data types don't match then an indes won't be used > you could try: > > select count(*) from billing where timestamp > (now()-60)::timestamp
In fact, I've had success with code like select count(*) from billing where timestamp > ( select now() - interval '1 minute' ) At least in my case (PostgreSQL 7.2, though), it made PostgreSQL magically do an index scan. :-) /* Steinar */ -- Homepage: http://www.sesse.net/ ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster