I'm designing a database for a web application project and I came to the conclusion I may have few queries that will require a lot of joined tables to just make one check.
I'm wondering how bad is it to store the foreign key somewhere on the way to decrease number of joins required for these queries?
To give you an example of what I have at this moment: Service => Booking => Transaction => Wallet => BonusOffer
I need to check whether the service has been bought with wallet associated with a bonus. Would it be wise to store BonusOffer id as foreign key of Transaction?
You could ask why Transaction - it's because most of these queries will "go through" Transaction and Transaction will be somewhere in the middle.