database - DB Fk/Pk keys performance -
in our db have single centric table millions of rows being inserted , updated. table has single column acting unique identifier , used link content of table mutliple tables 1 many relation.
this means wehn inserting entry to, say, users table, in same transaction users_pets , users_parents (and 10 more) populated, multiple rows, based on same unique identifier main table.
since application using db inserting new entries , updating existing ones relation between these tables kept @ application level (i.e. logical erd instead of handling via fk/pk decelrations).
questions:
- is correct assume pure performnces point of view, best approach?
- is there way set these keys (so db more self descriptive) without impacting performaces?
- no, same reason use seatbelts in cars when in hurry. difference negligeble , totally not worth it.
- some specific dbms vendors may offer way of declaring constraints while not enforcing them. in oracle example, can specify integrity constraint state
disable novalidate
.
Comments
Post a Comment