New answers tagged mysql-5.5
1
(Addressing first question)
Toss comment_unseen; instead, use a LEFT JOIN ... WHERE ... IS NULL or WHERE NOT EXISTS ( SELECT 1 FROM comment_seen WHERE ... )
For comment_seen, replace
CONSTRAINT user_id UNIQUE (user_id, comment_id)
with this (Note: a PK includes a uniqueness constraint):
PRIMARY KEY(user_id, comment_id)
If you need to look up which users ...
Top 50 recent answers are included
Related Tags
mysql-5.5 × 1196mysql × 957
innodb × 153
replication × 119
performance × 107
mysql-5.6 × 87
mysqldump × 50
query-performance × 42
myisam × 41
mysql-5 × 38
optimization × 36
mysql-5.7 × 31
mysql-5.1 × 31
backup × 29
mariadb × 29
database-design × 28
linux × 27
stored-procedures × 25
index × 24
mysql-workbench × 24
windows × 22
amazon-rds × 21
upgrade × 21
select × 20
trigger × 19