optimise queries on queue_log

when casting text into timestamp, postgres can't use
the index to speed up queries, which has a huge impact
on big datasets