Run query to database query ptimer