Add guards for limit, offset and having for materilized view