a dodgy mattress will heighten the pain. As many above have said the cause of the pain typically is lack of core muscle strength.
stretching is not the answer. (but it will relieve some of the pain)
mattress is not the answer.(but it will relieve some of the pain)
the answer is to build core muscle strength... slowly and regularly.
typically for cyclists - the lower pack pain is caused by lower back muscles to spasm (often due to lack of strength or injury), which in turn pulls the rear of the pelvis up, resulting in the hamstrings tightening. and then traps the sciatic nerves running over the pelvis and down the leg.
hamstring stretching thus is not the answer. (although it helps a little)
core muscle strengthening for lower back, side to side stability and front strength is the answer – as it ensures the pelvis is stable and not pulled out of alignment.
Yet - If you want a good mattress – then imo - take the time to go to John Lewis’ and try them out there… make sure you speak to and listen to the guys who run the department (they are the few mattress sales people who are actually trained and know what they are talking about) – they will listen to you and size you up, and find you something worth spending your money on. spend about £800 to a grand, on a relatively firm yet comfortable mattress and you’ll be making the right investment.