SQL errors with large inboxes