GGG
GGG

Reputation: 1437

How to hold different data with several same fields?

We want to store information about bank's credits but this information changes from bank to bank (for some banks user's id is important for others not). We are going to create one huge table and store all values from all banks there. Is for some bank fields is mandatory we will store actual value on the other hand if this field does not mean much we will store default value. But we see another way out, to create many small tables for each bank, but this decision seems to be very difficult to handle in the feature. Could you give an advise

Upvotes: 0

Views: 26

Answers (1)

serge
serge

Reputation: 1022

You need to create one table having a bank_id column as a discriminator. However, if the table is expected to be really huge (hundred of millions rows) you still can optimize the queries which affect only one bank: the solution is the table partitioning on the same column bank_id.

Upvotes: 1

Related Questions