Hacker News new | past | comments | ask | show | jobs | submit login

that is not true. the sub tables guarantee that value is unique in the entire column.

while main table did not have any such guarantees, so, there will be a lot of indexing and duplication in atleast 3 (of 4 sub tables)

Moreover, indexing would be much faster and efficient as there are only unique values in sub tables




Why wouldn't it have such guarantees, if the indices in question are defined as UNIQUE?


Because they are not unique in main table.

For eg: if there are multiple emails from same domain name, then domain name column will have same entry multiple times.

When domain is moved to sub table, main table still has duplicate entries, in form of foreign keys, while domain table has unique entry for each domain name


Foreign key columns (i.e. the ones in the main table) are often indexed themselves, and those indices can also be UNIQUE.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: