Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The USER_MESSAGES table is quite small - it's an intersection between MESSAGES and USERS (i.e. recipients). So that's two foreign key columns and perhaps a status. So although it might have lots of records they are not going to take up a lot of space. It's not as though you have to store an instance of the Message for each recipient. </p> <p>So storage is definitely not an issue. Performance might be what concerns you, but these days any decent database engine can insert thousands of records in a fraction of a second. It's just a matter of optimizing for set operation rather than individual rows. </p> <hr> <blockquote> <p>" I was just concerned that the table will grow big fast."</p> </blockquote> <p>You always have the option of housekeeping the table. If the recipients delete the "message" zap the intersection record. Perhaps add a date column and then timeout "messages" which haven't been read in a certain timeframe. Actually that sounds like a positive feature: given your business model the sender presumably wants timely replies and won't be interested in responses to a proposition which is three months old.</p> <blockquote> <p>" I was hoping there would be a more efficient/elegant one"</p> </blockquote> <p>It all depends on your definition of efficiency. Disk storage is cheap but also relatively slow. RAM is fast but relatively expensive (although SDD will be cheapish in a few years time). So what do you want to optimize? How long it takes John to send a mailshot? How long it takes Susan to read the message? How much you have to spend on hard drives? How much time you spend configuring your middle tier?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload