sql - How to deal with lots of parameters in database? -


let's need store 4 different document types somewhere (i.e, draft, sent approval, approved, rejected).

you can create new table , store there. seems bit excessive create table 4 entries.

another approach create 1 big table parameters in general , store them there. if ever in need of storing 4, 15 or 2000 new parameters, can insert them parameters table , store them there , not create new table.

but if number of parameters gets bigger? let's say, 1.000.000, 5.000.000 or more? best approach then?

i'm not talking particular database if help, it's either oracle 12c or openedge (progress) database.

but seems bit excessive create table 4 entries.

work well-designed databases while, , won't seem excessive.

the main problem 1 big "parameters" table foreign keys can reference unique row, not just rows want. example, if had 1 big table . . .

 draft sent approval approved rejected usa great britain california ... 

. . . sooner or later you'll have document type "california".

but stems fundamental misunderstanding of relational model. in relational model, domain consists of possible values particular attribute. there 4 possible values "document type" attribute. reliable data, dbms needs know that. , best way tell dbms there 4 possible values set foreign key reference column contains 4 values.

it's anti-pattern. search online "one true lookup table" or "otlt".


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -