Sunday, 18 March 2018

What are the types of PI (Primary Index) in Teradata?

The Teradata Primary index is not an index in the traditional sense, as it is not a lookup table. Instead, it is a mechanism that defines where each data row is physically located on the Teradata system. The primary index of a table may be defined as either a single column or as multiple columns. The values of the primary index columns within the table may be unique or non-unique. 

The Primary Index of a table should not be confused with the primary key of a table.The primary index is a part of the physical database model, and affects the storage and retrieval of data rows. The primary key is a part of the logical database model, and uniquely identifies each record in the table. Often, the primary key of a table is a good candidate for the primary index of a table, particularly for smaller “dimension” or “lookup” tables, but this is not always the case for other tables.

There are two types of Primary Index. Unique Primary Index ( UPI) and Non Unique Primary Index (NUPI). By default, NUPI is created when the table is created. Unique keyword has to be explicitly given when UPI has to be created.

UPI will slower the performance sometimes as for each and every row , uniqueness of the column value has to be checked and it is an additional overhead to the system but the distribution of data will be even. 

We should be careful while choosing a NUPI so that the distribution of data is almost even . UPI/NUPI decision should be taken based on the data and its usage.

Saturday, 14 October 2017

Overview Of Scala Programming Language- How To Install Scala ?

SCALA (Scalable Language)  is a modern programming language created by Martin Odersky , influenced by Java, Ruby, Smalltalk and others.

Scala smoothly and effortlessly integrates object-oriented and functional programming .It supports Java-like superior coding style and simultaneously supports a functional style.

Combining the strengths of the Functional and Imperative programming models, Scala is a great tool for building highly concurrent applications without surrendering the advantages of an OO methodology. 

Features of Scala Programming Language
  • Scala code runs on the JVM and allows you to use the affluence of Java libraries that have been developed over the years.
  • Features in object oriented programming (OOP) language such as Classes and inheritance are fully supported in Scala. Some other features in Scala are traits, objects and case classes.
  • Every variable here is an object (Variable definitions start with var ) and every “operator” is a method. It’s also has functional programming (FP) language, so you can pass functions (Function definitions start with def.) around as variables.
  • Scala has advanced language features and rich Java integration.You can write your Scala code using OOP, FP, or both.  
  • Scala has expressive syntax and static typing

Installing Scala Software
For Installing Scala On Unix systems download the software from the Scala download page to a directory on your computer like $HOME/scala, and then add these lines to your $HOME/.bash_profile file.
export SCALA_HOME=/Users/Al/scala

To Install Scala in Microsoft Windows you can follow equivalent process. Check the Scala download page for more information.

Books to Read on Scala
  1.          Programming in Scala: A comprehensive Step-by-Step Scala Programming Guide by MartinOdersky, Lex Spoon, Bill Venners
  2.          Scala for the Impatient by Cay Hortsmann
  3.          Scala in Depth by Joshua D Suereth
  4.          Introduction to the Art of Programming Using Scala by Mark Lewis
  5.          Atomic Scala by Eckel and Marsh
  6.          Functional Programming in Scala by Paul Chiusano and RĂșnar Bjarnason

Related Posts Plugin for WordPress, Blogger...