• nimdil (8/19/2009)

    The idea with four columns - while not bad - has some flaws:

    1. There is no merits with 1NF as IP address is a complete being. Would you store postal code with few char(1) columns?

    2. If you want to perform table wide bit operation with mask (mask may be from 0 to 32 actually) you will have to either map four tinyints to one int the same way it is presented in the article or map it to bigint. Not good for performance :>

    If you want readability - just use view with some ip_int_to_ip_string computed column.

    1. You do not know of subnetting? Do you also store first and last names of people together in one column?

    2. "Table wide bit operation" can be done using more than one column. Masks also are typically written by octet(s).

    A "ip_int_to_ip_string computed column" will impede performance, as will the functions in the article.

    The only "flaw" is that predicates, joins, etc. may need to use more than one column, and so more typing. The flaws with using integer are obvious from the need for such an article as this.