On Oct 8, 2007, at 6:14 , Nis Jørgensen wrote:
> Nis Jørgensen skrev:
>> SELECT *
>> FROM footable0
>> WHERE (date_created - interval '16 hours')::date = (now() -
>> interval '16
>> hours')::date;
>>
>> Tested.
>
> Unfortunately, the performance is horrible - it is using a seqscan.
You can create a functional index to improve performance here,
something like
create index rectified_created_at_idx on mytable (cast (created_at -
interval '16 hours') to date);
I haven't thought it through, but you may run into issues with time
zones -- this is not particular to this solution however.
Michael Glaesemann
grzm seespotcode net