1 vote

Which one is better, the OR operation or JOINING two tables in MySQL?

Design 2 is likely to be faster, at least for some cases. But let's be clear about the PK, etc: CREATE TABLE B ( A_id..., Entity ..., PRIMARY KEY(Entity, A_id), INDEX(A_id, Entity) ) ...
Rick James's user avatar
  • 76.3k
1 vote

Which one is better, the OR operation or JOINING two tables in MySQL?

You should design tables around the objects they represent and the use cases of those objects. Then performance tune after, especially since I'm about to make the same performance improvement ...
J.D.'s user avatar
  • 34.1k
1 vote
Accepted

better database design for nested relation (many-to-many-to-many?)

Is there any nice idea to design 'review' table? (it seems (many-to-many)-to-many (?) for me.) The seat_review table you show is not many-to-many-to-many. It's simply representing one many-to-many ...
Bill Karwin's user avatar
  • 13.1k
1 vote
Accepted

Separate small column updated a lot from large jsonb columns to optimize performance?

No, that is not necessary. The large JSON values seem to be stored out of line in a TOAST table. Then the update of d only has to write a new row to the main table, but the TOAST values stay the same. ...
Laurenz Albe's user avatar
  • 45.7k

Only top scored, non community-wiki answers of a minimum length are eligible