Wednesday, February 29, 2012

what does "granularity" mean when speaking of database

I'm kinda confused what exactly does "granularity" or "grain"means in database world.

So I just understand that this means "it's a measure of level of details of your data in a database". It's how you could get a minimal grains of your data or how you could get a detailed information of your data that's make sense.

From Wikipedia, it means,

Data granularity

The granularity of data refers to the fineness with which data fields are sub-divided. For example, a postal address can be recorded, with low granularity, as a single field:
  1. address = 200 2nd Ave. South #358, St. Petersburg, FL 33701-4313 USA
or with high granularity, as multiple fields:
  1. street address = 200 2nd Ave. South #358
  2. city = St. Petersburg
  3. postal code = FL 33701-4313
  4. country = USA
or even higher granularity:
  1. street = 2nd Ave. South
  2. address number = 200
  3. suite/apartment number = #358
  4. city = St. Petersburg
  5. state = FL
  6. postal-code = 33701
  7. postal-code-add-on = 4313
  8. country = USA
Higher granularity has overheads for data input and storage. This manifests itself in a higher number of objects and methods in the object-oriented programming paradigm or more subroutine calls for procedural programming and parallel computing environments. It does however offer benefits in flexibility of data processing in treating each data field in isolation if required. A performance problem caused by excessive granularity may not reveal itself until scalability becomes an issue.

In addition to this, in computing it similarly means the same thing with database but it speaks mostly of the time the computing can handle. From Wikipedia, this means,


In parallel computing, granularity means the amount of computation in relation to communication, i.e., the ratio of computation to the amount of communication.
Fine-grained parallelism means individual tasks are relatively small in terms of code size and execution time. The data is transferred among processors frequently in amounts of one or a few memory words. Coarse-grained is the opposite: data are communicated infrequently, after larger amounts of computation.
The finer the granularity, the greater the potential for parallelism and hence speed-up, but the greater the overheads of synchronization and communication.[2]
In order to attain the best parallel performance, the best balance between load and communication overhead needs to be found. If the granularity is too fine, the performance can suffer from the increased communication overhead. On the other side, if the granularity is too coarse, the performance can suffer from load imbalance.

Hope this is helpful to you.

Monday, February 27, 2012

Product Rule, Chain Rule and then Factoring

I found this video is really cool and easy to understand. Please have your attention during factoring because the author of the video did a long factorization of polynomials to make it shorten for the derivatives.

and this example also is quite easy,

Finding Partial Derivatives

In this video, I find this tutorial very easy for me to understand what is a partial derivative. It has good examples including a chain rule.