2013-05-06, 08:49 AM
Now Mybb use at least two DB entries to store full content of one private message. One for sender and one for recipient. Despite the fact that those entries are the same, mybb store each one. Imagine what happens when user send a PM for list of his buddies, or admin use mass mail - it creates many same records in DB.
To significantly reduce the database entry size, the existing database entry format must change. I suggest to use only one db record to store PM, and show this record for those who should see it.
For example:
1. PM id=1
2. create record to store PM content and users ID who and where must see this PM
3. show "pm id=1" in send folder for sender
4. show "pm id=1" in incoming folder for recipients
5. if user delete this PM then exclude his ID from DB record in step 2
6. if this PM was deleted by all users, clean DB from "pm id=1" entry
To significantly reduce the database entry size, the existing database entry format must change. I suggest to use only one db record to store PM, and show this record for those who should see it.
For example:
1. PM id=1
2. create record to store PM content and users ID who and where must see this PM
3. show "pm id=1" in send folder for sender
4. show "pm id=1" in incoming folder for recipients
5. if user delete this PM then exclude his ID from DB record in step 2
6. if this PM was deleted by all users, clean DB from "pm id=1" entry