I am creating a table to store information about the placement of objects in a grid (game map).
For example, I have a 10x10 grid and I want to store, in the database, that cell (5,5) has a blue box, (3,3) has a red chair and so on.
There can be multiple items in any square, but the same item shouldn't be in the same square twice.
is it acceptable to have this structure? (all columns in primary key)
(room_id (FK), room_object_id (FK), x_cell, y_cell)(PK)
or will it be better to have this
id(PK), room_id (FK), room_object_id (FK), x_cell, y_cell
I think the first way makes more sense, but I'm worried that increasing the integrity checks whenever something is entered might create a lot of unnecessary overhead.