• Steven.Grzybowski (8/11/2016)


    With the third normal form, is there any kind of general "rule of thumb" For when you should or should not apply it? I understand that a lot of small tables can cause performance issues, and that it can cause the database to become more complex, but is there any kind of rule about relative sizes of tables that should be split off? Also, for "smaller" fields (numeric values, small varchar fields), at which point does the performance difference between linking to another table vs having the data contained in the same table either become negligible or turn in favor of keeping things in one table?

    In a sort of similar vein, at which point does it make more sense to use a view rather than a table for something? While it is possible to use a view to pull up data, and having redundant data is bad, is it justifiable to have redundant data for speed purposes? For example, the table that would have redundant data in it is only a couple hundred MB, while the table that it could be joined to on a view is a few hundred GB, does it make sense to create redundant data, but in a smaller table for something that gets accessed frequently? For example - Table 1 (100,000 rows, 5 columns 3 are redundant data ) vs

    Table1 joined to table 2 (100,000,000 rows, 20 columns). While the building of table 1 and adding in of the redundant fields takes time, the joining to table2 takes place one time, vs having to join to table 2 every time somebody wants to look at the report.

    Do the two tables have a 1:1 relationship? If so, then the tables may be improperly designed. If not, then you need to put up with the join because, as Tom states, it's going to be a whole lot easier to maintain and, because of the reduced column width, could actually be faster that one huge denormalized table.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)