This episode was extracted from Sahih Al-Bukhari volume 1, Book 3, hadith  90, the Prophet spoke against lengthy prayer in consideration of people in need.