Saturday 5 September 2015

Dimensional Modeling Nomenclature


Normalization vs Denormalization

Normalization:

PROS:
  • When writes are more than reads
  • Vertically divided among columns i.e. split-ted into multiple tables.
  • Updates and Inserts will be effective since no duplicates.
  • Less use of heavy DISTINCT or GROUP BY queries since no duplicates.

CONS:
  • JOINS due to multiple tables.
  • Index strategies are not effective due to joins.

De-Normalization:

PROS:
  • When reads are more than writes.
  • SELECTS are very fast since we avoid JOINS and effective because of index strategies works very well with selective columns.

CONS:
  • Updates and INSERTS becomes costly.

In real time , you should be good enough to choose the most read or most write tables to apply this concepts.






Wednesday 2 September 2015

Unix Script to generate files based on unique values of a field

Below file has different mobile companies. I need to generate the files dynamically based on the unique values of the field.I can have blank values also.But I should not generate files for those.

Input:














Generate the Unique values :





Script to generate files based on the unique values. Here -z in the if condition represents the check for empty variable.










Output: