one twin primary keys many-to-many table?


i have following tables database have many-to-many relationship, spoken joining list unfamiliar keys primary keys any sure tables:




  • widget: widgetid (pk), title, cost

  • user: userid (pk), firstname, lastname



assume any user-widget multiple unique. i twin options structure joining list defines information relationship:




  1. userwidgets1: userwidgetid (pk), widgetid (fk), userid (fk)

  2. userwidgets2: widgetid (pk, fk), userid (pk, fk)



option 1 unparalleled buttress primary key. however, seems low given wholly information being stored list charge between twin primary tables, charge itself form unparalleled key. so streamer choice 2, two-column primary key, nonetheless loses one-column unparalleled identifier choice 1 has. i also optionally supplement two-column unparalleled index (widgetid, userid) initial table.



is there any genuine inadequacy between twin performance-wise, any reason move proceed over structuring userwidgets many-to-many table?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?