Context: A mobile note taking application that is connected to windows azure mobile services. (Sql Server Azure)
Currently I have 2 tables: Users & Notes.
A user downloads their respective notes by querying the Notes table and asking for all notes that have the userID match their own.
Example:
SELECT * FROM Notes WHERE userID = myID;
But now I want my users to be able to share notes between them, so...
I'm thinking of adding a "SharedList" & "SharedListMember" tables, where each note will have a shared list with their respective sharing members on the SharedListMember child table.
Example:
SELECT DISTINCT n.* FROM Notes n LEFT OUTER JOIN SharedList l ON n.list = l.id INNER JOIN SharedListMember lm ON l.id = lm.list WHERE (lm.memberID = myID OR n.userID = myID)
I have added a LEFT OUTER JOIN because not all tasks will be shared.
I would be adding indexes on Notes.list, SharedList.id (Primary Key) , SharedListMember.memberID, SharedListMember.list
Questions: How much performance impact can I expect with this setup ? Is there a faster way? I currently query about a 1000 notes in less than a second. What would happen if I've got 10 million notes ?