PERFORMANCE TUNING
64. What are the different levels at which performance improvement can be performed in Informatica?
65.What Can We Do To Improve The Performance Of Informatica Aggregator Transformation?
- records are sorted before passing to the aggregator and “sorted input” option under aggregator properties is checked.
- The record set should be sorted on those columns that are used in Group By operation.
- It is often a good idea to sort the record set in database level e.g. inside a source qualifier transformation, unless there is a chance that already sorted records from source qualifier can again become unsorted before reaching aggregator.
66.How The Informatica Server Increases The Session Performance Through Partitioning The Source?
- For a relational sources informatica server creates multiple connections for each partition of a single source and extracts separate range of data for each connection.
- Informatica server reads multiple partitions of a single source concurrently. Similarly for loading also informatica server creates multiple connections to the target and loads partitions of data concurrently.
- For XML and file sources, informatica server reads multiple files concurrently. For loading the data informatica server creates a separate file for each partition (of a source file). You can choose to merge the targets.
67. How can we increase Session Performance
- Minimum log (Terse)
- Partitioning source data
- Performing ETL for each partition, in parallel. (For this, multiple CPUs are needed)
- Adding indexes
- Changing commit Level
- Using Filter transformation to remove unwanted data movement
- Increasing buffer memory, when large volume of data
- Multiple lookups can reduce the performance. Verify the largest lookup table and tune the expressions.
- In session level, the causes are small cache size, low buffer memory and small commit interval
- Run concurrent sessions
- Partition session (Power center)
- Tune Parameter – DTM buffer pool, Buffer block size, Index cache size, data cache size, Commit Interval, Tracing level (Normal, Terse, Verbose Initialization, Verbose Data)
- The session has memory to hold 83 sources and targets. If it is more, then DTM can be increased.
- The Informatica server uses the index and data caches for Aggregate, Rank, Lookup and Joiner transformation.
- Remove Staging area
- Tune off Session recovery
- Reduce error tracing
The server stores the transformed data from the above transformation in the data cache
before returning it to the data flow. It stores group information for those transformations in index cache. If the allocated data or index cache is not large enough to store the date, the server stores the data in a temporary disk file as it processes the session data. Each time the server pages to the disk the performance slows. This can be seen from the counters. Since generally data cache is larger than the index cache, it has to be more than the index.
At system level,
- WIN NT/2000-Use the task manager
- UNIX: VMSTART, IOSTART
68.Hierarchy of optimization
- Target
- Source
- Mapping
- Session
- System
Optimizing Target Databases:
- Drop indexes /constraints
- Increase checkpoint intervals
- Use bulk loading /external loading
- Turn off recovery
- Increase database network packet size
Source level
- Optimize the query (using group by, group by)
- Use conditional filters
- Connect to RDBMS using IPC protocol
Mapping
- Optimize data type conversions
- Eliminate transformation errors
- Optimize transformations/ expressions
Session
- Concurrent batches
- Partition sessions
- Reduce error tracing
- Tune session parameters
System
- Improve network speed
- Use multiple preservers on separate systems
- Reduce paging
69. How do you handle performance issues in Informatica? Where can you monitor the performance?
There are several aspects to the performance handling .Some of them are:-
- Source tuning
- Target tuning
- Repository tuning
- Session performance tuning
- Incremental Change identification in source side.
- Software, hardware (Use multiple servers) and network tuning.
- Bulk Loading
- Use the appropriate transformation.
To monitor this
- Set performance detail criteria
- Enable performance monitoring
- Monitor session at runtime &/ or Check the performance monitor file .
70. What are performance counters?
- The performance details provide that help you understand the session and mapping efficiency. Each Source Qualifier, target definition, and individual transformation appears in the performance details, along with that display performance information about each transformation
- All transformations have some basic that indicates the number of input rows, output rows, and error rows.Source Qualifiers, Normalizes, and targets have additional that indicates the efficiency of data moving into and out of buffers.
- You can use these to locate performance bottlenecks.
- Some transformations have specific to their functionality. For example, each Lookup transformation has an indicator that indicates the number of rows stored in the lookup cache. When you read performance details, the first column displays the transformation name as it appears in the mapping, the second column contains the name, and the third column holds the resulting number or efficiency percentage.
- When you partition a source, the Informatica Server generates one set of for each partition.
- The following performance illustrate two partitions for an Expression
transformation:
Transformation Counter Value
EXPTRANS [1]
o Expression_input rows 8
o Expression_output rows 8
EXPTRANS [2]
o Expression_input rows 16
o Expression_output rows 16
Note: When you partition a session, the number of aggregate or rank input rows may be different from the number of output rows from the previous transformation.
71.Explain how the performance of joiner transformationcan be increased.
- Perform joins in a database when possible.
In some cases, this is not possible, such as joining tables from two different databases or flat file systems. To perform a join in a database, we can use the following options:
Create and Use a pre-session stored procedure to join the tables in a database.
Use the Source Qualifier transformation to perform the join.
- Join sorted data when possible
- For an unsorted Joiner transformation, designate the source with fewer rows as the master source.
- For a sorted Joiner transformation, designate the source with fewer duplicate key values as the master source
72.PERFORMANCE TUNING OF LOOKUP TRANSFORMATIONS
Lookup transformations are used to lookup a set of values in another table.Lookups slows down the performance.
- To improve performance, cache the lookup tables. Informatica can cache all the lookup and reference tables; this makes operations run very fast.
- Even after caching, the performance can be further improved by minimizing the size of the lookup cache. Reduce the number of cached rows by using a sql override with a restriction.
- Cache: Cache stores data in memory so that Informatica does not have to read the table each time it is referenced. This reduces the time taken by the process to a large extent. Cache is automatically generated by Informatica depending on the marked lookup ports or by a user defined sql query.
Example for caching by a user defined query: –
Suppose we need to lookup records where employee_id=eno.
‘employee_id’ is from the lookup table, EMPLOYEE_TABLE and ‘eno’ is the
input that comes from the from the source table, SUPPORT_TABLE.
We put the following sql query override in Lookup Transform
‘select employee_id from EMPLOYEE_TABLE’
If there are 50,000 employee_id, then size of the lookup cache will be 50,000.
Instead of the above query, we put the following:-
‘select emp employee_id from EMPLOYEE_TABLE e, SUPPORT_TABLE s
where e. employee_id=s.eno’
If there are 1000 eno, then the size of the lookup cache will be only 1000.But here the performance gain will happen only if the number of records in SUPPORT_TABLE is not huge. Our concern is to make the size of the cache as less as possible.
- In lookup tables, delete all unused columns and keep only the fields that are used in the mapping.
- If possible, replace lookups by joiner transformation or single source qualifier.Joiner transformation takes more time than source qualifier transformation.
- If lookup transformation specifies several conditions, then place conditions that use equality operator ‘=’first in the conditions that appear in the conditions tab.
- In the sql override query of the lookup table, there will be an ORDER BY clause. Remove it if not needed or put fewer column names in the ORDER BY list.
- Do not use caching in the following cases: –
- -Source is small and lookup table is large.
- -If lookup is done on the primary key of the lookup table.
- Cache the lookup table columns definitely in the following case: –
- If lookup table is small and source is large.
- If lookup data is static, use persistent cache. Persistent caches help to save and reuse cache files. If several sessions in the same job use the same lookup table, then using persistent cache will help the sessions to reuse cache files. In case of static lookups, cache files will be built from memory cache instead of from the database, which will improve the performance.
- . If source is huge and lookup table is also huge, then also use persistent cache.
- If target table is the lookup table, then use dynamic cache. The Informatica server updates the lookup cache as it passes rows to the target.
- Use only the lookups you want in the mapping. Too many lookups inside a mapping will slow down the session.
- If lookup table has a lot of data, then it will take too long to cache or fit in memory. So move those fields to source qualifier and then join with the main table.
- If there are several lookups with the same data set, then share the caches.
- If we are going to return only 1 row, then use unconnected lookup.
- All data are read into cache in the order the fields are listed in lookup ports. If we have an index that is even partially in this order, the loading of these lookups can be speeded up.
- If the table that we use for look up has an index (or if we have privilege to add index to the table in the database, do so), then the performance would increase both for cached and un cached lookups.
73. How are indexes created after completing the load process?
- For the purpose of creating indexes after the load process, command tasks at session level can be used.
- Index creating scripts can be brought in line with the session’s workflow or the post session implementation sequence.
- Moreover this type of index creation cannot be controlled after the load process at transformation level.
74. Which one is faster Connected or Unconnected Lookup?
- There can be some very specific situation where unconnected lookup may add some performance benefit on total execution.
- If you are calling the “Unconnected lookup” based on some condition(e.g. calling it from an expression transformation only when some specific condition is met – as opposed to a connected lookup which will be called anyway) then you might save some “calls” to the unconnected lookup, thereby marginally improving the performance.
- The improvement will be more apparent if your data volume is really huge. Keep the “Pre-build Lookup Cache” option set to “Always disallowed” for the lookup, so that you can ensure that the lookup is not even cached if it is not being called, although this technique has other disadvantages, check
http://www.dwbiconcepts.com/etl/14-etl-informatica/46-tuning-informatica-lookup.html , especially the points under following subheadings:
– Effect of choosing connected OR Unconnected Lookup, and
– WHEN TO set Pre-build Lookup Cache OPTION (AND WHEN NOT TO)
75. Scenario Implementation 1
What would be the best approach to update a huge table (more than 200 million records) using Informatica.The table does not contain any primary key. However there are a few indexes defined on it. The target table is partitioned. On the other hand the source table contains only a few records (less than a thousand) that will go to the target and update the same. Is there any better approach than just doing it by an update strategy transformation?
- Since the target busy percentage is 99.99% it is very clear that the bottleneck is on the target. So we need tweak the target.
- Since the target tale is partitioned on time_id, you need to include in the WHERE clause of the SQL fired by Informatica. For that you can define the time_id column as primary key in the target definition. With this your update query will have the time_id in the where clause.
- With Informatica update strategy, it fires update sql for every row which is marked for update by update strategy. To avoid multiple update statements you can INSERT all the records which is meant to be UPDATE into a temporary table. Then use a correlated sql to update the records in the actual table (200M table). This query can be fires as a post session SQL.
- Please see the sample SQL UPDATE TGT_TABLE U SET (U.COLUMNS_LIST /*Column List to be updated*/) = (SELECT I.COLUMNS_LIST /*Column List to be updated*/ FROM UPD_TABLE I WHERE I.KEYS = U.KEYS AND I.TIME_ID = U.TIME_ID)
WHERE EXISTS (SELECT 1 FROM UPD_TABLE I WHERE I.KEYS = U.KEYS AND I.TIME_ID = U.TIME_ID) TGT_TABLE – - Actual table with 200M records UPD_TABLE – Table with records meant for UPDATE (1K record) We need to make sure that your indexes are up to date and stats are collected. Since this is more to be done with DB performance, you may need the help of DBA as well to check the DB throughput, SQL cost etc Hope this will help you.
76. How do you identify the bottlenecks in Mappings?
Identifying Targets Bottlenecks:
The most common performance bottleneck occurs when the informatica server writes to a target database.You can identify target bottleneck by configuring the session to write to a flat file target. If the session performance increases significantly when you write to a flat file, you have a target bottleneck.
Tasks to be performed to increase performance:
-
- Drop or Disable index or constraints
- Perform bulk load (Ignores Database log)
- Increase commit interval (Recovery is compromised)
- Tune the database for RBS, Dynamic Extension etc.,
- Increase checkpoint intervals.
- Use external loading.
- Increase database network packet size.
- Optimize target databases.
Identifying Sources Bottlenecks:
-
- Sources – Set a filter transformation after each SQ and see the records are not through. If the time taken is same then there is a problem.If source is a relational table, put a filter transformation in the mapping, just after source qualifier; make the condition of filter to FALSE. So all records will be filtered off and none will proceed to other parts of the mapping.In original case, without the test filter, total time taken is as follows:-Total Time = time taken by (source + transformations + target load)Now because of filter, Total Time = time taken by sourceSo if source was fine, then in the latter case, session should take less time. Still if the session takes near equal time as former case, then there is a source bottleneck.
- You can also identify the Source problem by Read Test Session – where we copy the mapping with sources, SQ and remove all transformations and connect to file target. If the performance is same then there is a Source bottleneck.
- Using database query – Copy the read query directly from the log. Execute the query against the source database with a query tool. If the time it takes to execute the query and the time to fetch the first row are significantly different, then the query can be modified using optimizer hints.
Tasks to be performed to increase performance:
-
- Optimize Queries using hints.
- Use indexes wherever possible.
Identifying Mapping Bottlenecks:
If both Source and target are OK then problem could be in mapping. Add a filter transformation before target and if the time is the same then there is a problem. (OR) Look for the performance monitor in the Sessions property sheet and view the counters.
Tasks to be performed to increase performance:
- If High error rows and rows in lookup cache indicate a mapping bottleneck.
- Optimize Single Pass Reading:
- Optimize Lookup transformation :
o Caching the lookup table: When caching is enabled the Informatica server caches the lookup table and queries the cache during the session. When this option is not enabled the server queries the lookup table on a row-by row basis. Static, Dynamic, Shared, Un-shared and Persistent cache
o Optimizing the lookup condition: Whenever multiple conditions are placed, the condition with equality sign should take precedence.
o Indexing the lookup table: The cached lookup table should be indexed on order by columns. The session log contains the ORDER BY statement The un-cached lookup since the server issues a SELECT statement for each row passing into lookup transformation, it is better to index the lookup table on the columns in the condition
- Optimize Filter transformation:
- You can improve the efficiency by filtering early in the data flow. Instead of using a filter transformation halfway through the mapping to remove a sizable amount of data.
- Use a source qualifier filter to remove those same rows at the source, If not possible to move the filter into SQ, move the filter transformation as close to the source qualifier as possible to remove unnecessary data early in the data flow.
- Optimize Aggregate transformation:
- Group by simpler columns. Preferably numeric columns.
- Use Sorted input. The sorted input decreases the use of aggregate caches. The server assumes all input data are sorted and as it reads it performs aggregate calculations.
- Use incremental aggregation in session property sheet.
- Optimize Seq. Generator transformation:
- Try creating a reusable Seq. Generator transformation and use it in multiple mappings
- The number of cached value property determines the number of values the nformatica server caches at one time.
- Optimize Expression transformation:
- Factoring out common logic o Minimize aggregate function calls.
- Replace common sub-expressions with local variables.
- Use operators instead of functions.
The best time in the development cycle is after system testing. Focus on mapping-level optimization only after optimizing the target and source databases.
Use Session Log to identify if the source, target or transformations are the performance bottleneck
-
- Avoid executing major sql queries from mapplets or mappings.
- Use optimized queries when we are using them.
- Reduce the number of transformations in the mapping. Active transformations like rank, joiner, filter, aggregator etc should be used as less as possible.
- Remove all the unnecessary links between the transformations from mapping.
- If a single mapping contains many targets, then dividing them into separate mappings can improve performance.
- If we need to use a single source more than once in a mapping, then keep only one source and source qualifier in the mapping. Then create different data flows as required into different targets or same target.
- If a session joins many source tables in one source qualifier, then an optimizing query will improve performance.
- In the sql query that Informatica generates, ORDERBY will be present. Remove the ORDER BY clause if not needed or at least reduce the number of column names in that list. For better performance it is best to order by the index field of that table.
- Combine the mappings that use same set of source data.
- On a mapping, field with the same information should be given the same type and length throughout the mapping. Otherwise time will be spent on field conversions.
- Instead of doing complex calculation in query, use an expression transformer and do the calculation in the mapping.
- If data is passing through multiple staging areas, removing the staging area will increase performance.
- Stored procedures reduce performance. Try to keep the stored procedures simple in the mappings.
- Unnecessary data type conversions should be avoided since the data type conversions impact performance.
- Transformation errors result in performance degradation. Try running the mapping after removing all transformations. If it is taking significantly less time than with the transformations, then we have to fine-tune the transformation.
- Keep database interactions as less as possible.
Identifying Sessions Bottlenecks:
Sessions: If you do not have a source, target, or mapping bottleneck, you may have a session bottleneck.You can identify a session bottleneck by using the performance details. The informatica server creates performance details when you enable Collect Performance Data on the General Tab of the session properties.
Performance details display information about each Source Qualifier, target definitions, and individual transformation. All transformations have some basic counters that indicate the Number of input rows, output rows, and error rows. Any value other than zero in the readfromdisk and writetodisk counters for Aggregate, Joiner, or Rank transformations indicate a session bottleneck.
We can use the session log to identify whether the source, target or transformations are the performance bottleneck. Session logs contain thread summary records like the following:-
MASTER> PETL_24018 Thread [READER_1_1_1] created for the read stage of partition point [SQ_test_all_text_data] has completed: Total Run Time =[11.703201] secs, Total Idle Time = [9.560945] secs, Busy Percentage =[18.304876].
MASTER> PETL_24019 Thread [TRANSF_1_1_1_1] created for the transformation stage of partition point [SQ_test_all_text_data] has completed: Total Run Time = [11.764368] secs, Total Idle Time = [0.000000] secs, Busy Percentage = [100.000000].
If busy percentage is 100, then that part is the bottleneck.
Basically we have to rely on thread statistics to identify the cause of performance issues. Once the ‘Collect Performance Data’ option (In session ‘Properties’ tab) is enabled, all the performance related information would appear in the log created by the session.
DATABASE OPTIMISATION
To gain the best Informatica performance, the database tables, stored procedures and queries used in Informatica should be tuned well.
- If the source and target are flat files, then they should be present in the system in which the Informatica server is present.
- Increase the network packet size.
- The performance of the Informatica server is related to network connections.Data generally moves across a network at less than 1 MB per second, whereas a local disk moves data five to twenty times faster. Thus network connections often affect on session performance. So avoid network connections.
- Optimize target databases.
in the order source, target, transformations, mapping and session. After identifying the bottleneck, apply the tuning mechanisms in whichever way they are applicable to the project.
Identify bottleneck in Transformation
- Remove the transformation from the mapping and run it. Note the time taken.Then put the transformation back and run the mapping again. If the time taken now is significantly more than previous time, then the transformation is the bottleneck.
- But removal of transformation for testing can be a pain for the developer since that might require further changes for the session to get into the ‘working mode’.
- So we can put filter with the FALSE condition just after the transformation and run the session. If the session run takes equal time with and without this test filter,then transformation is the bottleneck.
Optimizing the Bottleneck’s
- If the source is a flat file, ensure that the flat file is local to the Informatica server. If source is a relational table, then try not to use synonyms or aliases.
- If the source is a flat file, reduce the number of bytes (By default it is 1024 bytes per line) the Informatica reads per line. If we do this, we can decrease the Line Sequential Buffer Length setting of the session properties.
- If possible, give a conditional query in the source qualifier so that the records are filtered off as soon as possible in the process.
- In the source qualifier, if the query has ORDER BY or GROUP BY, then create an index on the source table and order by the index field of the source table.
System (Networks)
77.PUSH DOWN OPTIMISATION
You can push transformation logic to the source or target database using pushdown optimization. When you run a session configured for pushdown optimization, the Integration Service translates the transformation logic into SQL queries and sends the SQL queries to the database. The source or target database executes the SQL queries to process the transformations.
The amount of transformation logic you can push to the database depends on the database, transformation logic, and mapping and session configuration. The Integration Service processes all transformation logic that it cannot push to a database.
Use the Pushdown Optimization Viewer to preview the SQL statements and mapping logic that the Integration Service can push to the source or target database. You can also use the Pushdown Optimization Viewer to view the messages related to pushdown optimization.
The following figure shows a mapping containing transformation logic that can be pushed to the source database:
This mapping contains an Expression transformation that creates an item ID based on the store number 5419 and the item ID from the source. To push the transformation logic to the database, the Integration Service generates the following SQL statement:
INSERT INTO T_ITEMS(ITEM_ID, ITEM_NAME, ITEM_DESC) SELECT CAST((CASE WHEN 5419 IS NULL THEN ” ELSE 5419 END) + ‘_’ + (CASE WHEN ITEMS.ITEM_ID IS NULL THEN ” ELSE ITEMS.ITEM_ID END) AS INTEGER), ITEMS.ITEM_NAME, ITEMS.ITEM_DESC FROM ITEMS2 ITEMS
The Integration Service generates an INSERT SELECT statement to retrieve the ID, name, and description values from the source table, create new item IDs, and insert the values into the ITEM_ID, ITEM_NAME, and ITEM_DESC columns in the target table. It concatenates the store number 5419, an underscore, and the original ITEM ID to get the new item ID.
Pushdown Optimization Types
You can configure the following types of pushdown optimization:
- Source-side pushdown optimization. The Integration Service pushes as much transformation logic as possible to the source database.
- Target-side pushdown optimization. The Integration Service pushes as much transformation logic as possible to the target database.
- Full pushdown optimization.The Integration Service attempts to push all transformation logic to the target database. If the Integration Service cannot push all transformation logic to the database, it performs both source-side and target-side pushdown optimization.
78.What are the Limitations of Pushdown Optimization?
- Rank T/R cannot be pushed
- Transaction control T/R
- Sorted aggregation.
Procedure:
1. Design a mapping with filter, rank and expression T/R.
2. Create a session Double click the session select properties tab.
Attribute | Value |
Pushdown optimization | Full |
3. Select the mapping tab set reader, writer connection with target load type normal.
4. Click apply click ok
save the session.
5. Create & start workflow.
Pushdown Optimization Viewer:-
MISCELLANEOUS
79.What Is The Procedure To Load The Fact Table. Give In Detail?
Based on the requirement to your fact table, choose the sources and data and transform it based on your business needs. For the fact table, you need a primary key so use a sequence generator transformation to generate a unique key and pipe it to the target (fact) table with the foreign keys from the source tables.
80.What is meant by Target load plan?
Target Load Order:
Target load order (or) Target load plan is used to specify the order in which the integration service loads the targets. You can specify a target load order based on the source qualifier transformations in a mapping. If you have multiple source qualifier transformations connected to multiple targets, you can specify the order in which the integration service loads the data into the targets.
Target Load Order Group:
A target load order group is the collection of source qualifiers, transformations and targets linked in a mapping. The integration service reads the target load order group concurrently and it processes the target load order group sequentially. The following figure shows the two target load order groups in a single mapping.
Use of Target Load Order:
Target load order will be useful when the data of one target depends on the data of another target. For example, the employees table data depends on the departments data because of the primary-key and foreign-key relationship. So, the departments table should be loaded first and then the employees table. Target load order is useful when you want to maintain referential integrity when inserting, deleting or updating tables that have the primary key and foreign key constraints.
Target Load Order Setting:
You can set the target load order or plan in the mapping designer. Follow the below steps to configure the target load order:
- Login to the PowerCenter designer and create a mapping that contains multiple target load order groups.
- Click on the Mappings in the toolbar and then on Target Load Plan. The following dialog box will pop up listing all the source qualifier transformations in the mapping and the targets that receive data from each source qualifier.
- Select a source qualifier from the list.
- Click the Up and Down buttons to move the source qualifier within the load order.
- Repeat steps 3 and 4 for other source qualifiers you want to reorder.
- Click OK..
Design mapping applications that first loads the data into the dimension tables. And then load the data into the fact table.
- Load Rule:- If all dimension table loadings are success then load the data into fact table.
- Load Frequency:- Database gets refreshed on daily loads, weekly loads and montly load
82.What is the difference between active and passive transformation?
- Active Transformation:- An active transformation can perform any of the following actions:
- Change the number of rows that pass through the transformation: For instance, the Filter transformation is active because it removes rows that do not meet the filter condition.
- Change the transaction boundary: For e.g., the Transaction Control transformation is active because it defines a commit or roll back transaction based on an expression evaluated for each row.
- Change the row type: For e.g., the Update Strategy transformation is active because it flags rows for insert, delete, update, or reject.
- Passive Transformation: A passive transformation is one which will satisfy all these conditions:
- Does not change the number of rows that pass through the transformation
- Maintains the transaction boundary
- Maintains the row type
83. How can we create Index after completion of Load Process ?
Truncate-Reload:
In Truncate-Reload Logic, the target table is always truncated before data is loaded to the target table.
Normally, the truncate command or Stored-procedure (SQL Command/ Stored Procedure) is called in the Pre-SQL Session property or the Truncate Table option is checked in the Session Properties.
Our Requirement:
In our Project there was a requirement, that:
- The Target table should only be truncated in case where the number of Source Records are greater than 0.
- If the No. of Source Records are equal to 0 then there should not be any truncate/load on the Target table.
How to Achieve this:
3 ways to incorporate this logic:
- Target Load Plan at the Mapping Level in the same Mapping
- Creating multiple Mappings/Sessions in the same Workflow
- Using a Unix Script in the same Session through Pre-Session Command\