I have defined various text value by int. I store int value in data table for better and fast search. I have three options to display text value:
-
I declare Enum in my codes and display text value according to int value. It is static and I have to change code if new values is to be added.
-
To make it dynamic, I can store int and text value in a table which is in another database and admin own it. New values can be updated by admin in this table. I use inner join to display text value whenever a record is fetched.
-
I store actual text in respective data table. This will make search slow.
My question is which option is best to use under following condition?
- Data table has more than records between 1 and 10 millions.
- There are more than 5000 users doing fetch, search, update process on table.
- Maximum text values are 12 in number and length (max) 50 char.
- There are 30 data tables having above conditions and functions.
I like combination of option #2 and option #1 – to use int’s but have dictionary table in another database.
Let me explain: