Teradata Utilities – FASTLOAD part 2



Phases of Fastload

Fastload divides its job into two phases


1)       Phase 1 – Acquisition

2)      Phase 2 – Application

Phase 1 – Acquisition

  • The main objective of this phase is to send rows of data file from HOST computer to Teradata AMPs as fast as possible.
  • Rows of the data file are packed into 64k blocks and send it to PE.
  • PE will parse the SQL of Fastload and send the Explain plan to each AMP. It will by default create 1 session per AMP, so if your system has 200 AMP then it will make 200 sessions for 1 Fastload job.

TipIt is advisable to restrict the session with the help of .SESSION command so that Fastload job don’t end up taking all the available resources of the system.

  • After creation of sessions the 64k blocks data is passed to AMP with the help of PE and BYNET where it is quickly hashed according to its PI value.
  • Based on this row hash value the rows are then redistributed to its proper AMP. Internal redistribution takes place within AMP, so that each AMP gets the correct row. To know more about this redistribution based on row hash please refer –Primary Index in Teradata
  • Now each row is placed in its proper AMP, but they are not sorted till now.
  • Any error in this phase will be recorded in the Error table 1.

Phase 2 – Application

  • The main objective of this phase is to store each row into the actual target table.
  • The rows are sorted by AMP which is temporarily stored in its DISK during phase 1
  • These sorted rows then send to actual target table where they will reside permanently.
  • All these operation are BLOCK level operation thus giving more speed when we compare it ROW level operation.
  • Any error in this phase will be stored in Error table 2.

Limitations of FAST LOAD 

There are few limitations which we have on Fastload.

These limitations are necessary for Fastload to load data with the lightning fast speed into tables.

  • NO SECONDARY INDEXES ARE ALLOWED ON TARGET TABLE – Fastload can load tables only with primary indexes defined on it. If we have a secondary index on the table then Fastload will not load that table. We get an error message if we load such type of table –

If secondary index exist already, we need to drop them.

After loading the table through Fastload we can easily recreate them on the table.

CREATE INDEX (Column-name/s) ON dbname.tablename —— > creates Non Unique Secondary Index

or

CREATE UNIQUE INDEX (Column-name/s) ON dbname.tablename —— > creates Unique Secondary Index

TIP Fastload Allows loading of PPI table.

  • NO REFERENTIAL INTEGRITY IS ALLOWED – Fastload cannot load data into tables that are defined with Referential Integrity (RI). This would require too much system checking to prevent referential constraints to a different table
  • NO TRIGGERS ARE ALLOWED AT LOAD TIME – Fastload is much too focused on speed to pay attention to the needs of other tables, which is what Triggers are all about. Additionally, these require more than one AMP and more than one table. Fastload does one table only. Simply ALTER the Triggers to the DISABLED status prior to using Fastload.
  • DUPLICATE ROWS ARE NOT SUPPORTED – Multiset tables are a table that allow duplicate rows — that is when the values in every column are identical. When Fastload finds duplicate rows, they are discarded. While Fastload can load data into a multi-set table, Fastload will not load duplicate rows into a multi-set table because Fastload discards duplicate rows

To know more about Fastload check below mentioned links –


Fastload Part 1

Fastload part 3

Fastload Part 4

 

29 comments

Skip to comment form

  1. wLIVSMdTBxCApKGoa

  2. Brlbetapp1? Curti demais a plataforma! Interface limpa e fácil de usar, e os bônus são bem generosos. Vale a pena experimentar brlbetapp1.

  3. About to Dive into pk36game! Wish me luck. Maybe this will become my new favorite? Take a look here: pk36game

  4. Okay, so I gave winph11 a whirl. They got a decent selection, nothing too wild. Customer service was responsive when I had a question. Not the flashiest site, but gets the job done. Give it a look-see!

    • sri on February 13, 2019 at 1:52 pm
    • Reply

    Nice Explanation 🙂

    • jakeer hussain khan on July 28, 2018 at 5:44 pm
    • Reply

    i need exact answer in aquisition phase on fload

    • Passionate Coder on April 21, 2018 at 1:49 pm
    • Reply

    Dear Admin,
    Can you please tell me why secondary indexes are not allowed in fastload.

    Thanks in advance.

    • Vaibhav kumar on March 6, 2016 at 6:06 pm
    • Reply

    i tried making two sessions in fasload 1st got passed with inserion and 2nd didnt showed any such behaviour.
    so why can’t we have multiple sessions in fastload?

    • Rahul Agrawal on September 28, 2015 at 1:44 pm
    • Reply

    If I use fastload to load a set table from a multiset table which have duplicates, will fastload utility allow this or it will fail? Please provide some insight on this.

    1. fastload will not fail because of duplicates, instead of that it will discard the duplicates and stored the count of duplicated rows.

    • Sudha on March 21, 2015 at 12:05 pm
    • Reply

    Hi Admin,

    Can we use fast load for loading the data from multiple files.if yes, where has to mention the multiple file.

    Thanks In Advance,
    Sudha

    • Divya on October 3, 2014 at 10:06 am
    • Reply

    As am new to teradata….Is it possible to use MODIFY USER command inside the stored procedure…

    • Chaithanya Reddy on July 28, 2014 at 3:12 am
    • Reply

    Hi,
    I am new to teradata,will FLoad loads data to staging

    1. yes

    • Tejas More on January 28, 2014 at 8:04 am
    • Reply

    Hi,
    I have a query here.
    In FLOAD phase2 (application) you said that the data is sorted and then send to actual target table.

    May I know this sorting is on what basis? Is it on the basis of hash value or something else ?

    Thanks,
    Tejas.

    1. Hi,

      Sorting is on row hash only.

    • Kumar on December 10, 2013 at 6:39 pm
    • Reply

    Thanks for the information. its really easy to understand with the way you are explaining. Can you also explain about other utilities in Teradata and also to how to execute fastload scripts in unix with an example.

    Thanks
    Kumar

    • sujit on November 29, 2013 at 6:40 pm
    • Reply

    Nice explaination admin:)

    • karthik on August 18, 2013 at 3:33 pm
    • Reply

    Hi admin,
    can we use Multiset table as target table in Fastload?

    1. You can use multiset table in fastload loading, however it wont support the multiset table feature (duplicate row)

    • karthik on August 18, 2013 at 3:27 pm
    • Reply

    Fastload does not allow duplicate due to “RESTART LOGIC”. Could you please elaborate this?

  5. Hi Admin,
    Thanks for your explanation. it is easy to grab.

    Can you please put some information about TASM and how it works. We can not see any related topics here.

  6. Hi Admin,
    One doubt pls clarify.
    In first phase data is read from flat file ,hashing done on it and stored on AMP without sorting.
    In second phase data is sorted as per AMP and loaded to final actual table.
    As per my understanding storing data in table is same as storing data in AMP.
    then how these steps differ?
    Pls clarify. Thanks in advance.

    Regards
    Karan

    1. to speed up the process and avoid unnecessary lock of the target table, in first phase only redistribution happens, then in second phase target tables are locked and after sorting, those rows are inserted into target tables.
      The difference in both the steps is the task which they are doing.

    • Priya on June 5, 2013 at 9:09 am
    • Reply

    Hi Admin,
    Can you post on other utilities like multiload and fastexport. Because all the posts here are very easy to understand and the informations are very good.

    1. will post soon 🙂

    • priya on October 7, 2012 at 12:54 pm
    • Reply

    Hi Admin,

    Really very nice and clear explanation..

    1. Thanks Priya ..

        • munish on March 24, 2013 at 7:26 pm
        • Reply

        Hi admin,
        i am new to teradata , i find this information is really useful. thanks.

Leave a Reply to Sudha Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.