Subscribe to DSC Newsletter

When to use a view and when a table, the fuzz about it for analysis

When to use a view and table?
Is it an art? I doubt it. Only when you cannot explain it and depends on feeling, it is an art.
Recently we are revising our codes and this question of giving guidance.on when to use table and view come to me. I consider the following questions:
1. when does it justify a table/view?
Having worked in a team setting on modeling and reporting works, the key to me is readability. leveraging my programming learning on object oriented concept, every object exists for a purpose, with set of inputs, preconditions, processes and output. When you feel that the same processes can be reused for other reports or analysis, I created a view or table for it. For those of you from the database admin, put down your judgement adhereing to normalization, listen: the cost of screwing the model or analysis leading to wrong business decision outweights the cost of harddisk.
2. View or table?
To choose between, view is always preferred as it takes less disk space and one less program that creates the table. (now we are talking admin :)). Only when the same data is queried very often or very big in size, when performance in speed is needed,I use a table.
I believe that our task is to define as clearly as possible our programming style for data analysis, even now it is empty in the programming literature.

Views: 665

Comment

You need to be a member of AnalyticBridge to add comments!

Join AnalyticBridge

Comment by Jeffrey Ng on May 26, 2013 at 8:44pm
data warehouse, the place for analysis.
Comment by Djoni Darmawikarta on May 26, 2013 at 12:22pm

An additional question: Is the existing table a table of a data warehouse, or a table of an operational system?

Comment by Jeffrey Ng on May 26, 2013 at 1:03am
thanks for your question. it's creating a new view or a new table with data from other table from the database. When doing data analysis, eg preparing dataset to be fed to the data mining algorithm. many people prefer to keep a view rather than creating table in order to save disk space. I have a different opinion, which may require a balance between speed of selecting the data and storage space.
Comment by Djoni Darmawikarta on May 25, 2013 at 10:58am

Is it a choice between "creating a view over an existing table" or "using the existing table directly" ?

On Data Science Central

© 2019   AnalyticBridge.com is a subsidiary and dedicated channel of Data Science Central LLC   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service