I have Messages table in DynamoDB. It has four columns sender, timestamp, message, recipient. I was wondering instead of creating a partition key using any one of the four columns, why not create another columns for partitioning purposes concatenating sender×tamp&recipient.
So this column will hold data like JohnSmithID1461754484307SallyMcDonaldID.
By doing this, when searching for message from a particular sender&recipient combo, I can query by just using this one column using query like (begin with & end with). And there are a few other ways of utilizing this column.
Question 1. Am I being over complicating things here by trying to use one column instead of spreading my query into a few columns?
Question 2. Is there a noticeable performance benefit by taking this direction?
Question 3. Is this design pattern only worthwhile if I eliminate column SenderId & RecipientID for data size purposes? (I need timestamp column for sort key)