Time in bed and restorative sleep are not always the same thing.
An irregular schedule, repeated awakenings, medicines, stress, or a health condition can contribute to feeling unrefreshed. A vivid dream by itself does not identify the cause. Keep a simple record of sleep and wake times, awakenings, and daytime sleepiness. Persistent symptoms deserve a conversation with a healthcare professional; mention gasping, loud snoring, or observed breathing pauses. A comfortable room can help you rest, but a mattress or sleep app should not replace assessment of possible breathing problems.
General information; not a diagnosis or a substitute for professional advice.
What should I write in a sleep diary?
Write down when you go to bed, roughly when you fall asleep, when you wake during the night, and when you get up. Add naps, caffeine or alcohol timing, and how sleepy you feel during the day. A simple record is more useful than trying to score every night perfectly. Keep it privately and bring it to a clinician if tiredness persists; it is a record of patterns, not a diagnosis.