How different are user defined SQL and the generated SQL
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 143
- Joined: Thu Nov 04, 2004 6:53 am
How different are user defined SQL and the generated SQL
Is there any performance difference if we use a userdefined sql as a generated SQL???
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 108
- Joined: Sat Feb 05, 2005 6:52 pm
- Location: US
user defined Sql query is one of the performance tunning tec
user defined Sql query is one of the performance tunning techique in DS. It is always a better option that generated one. you can use all type of oracle or any database inbuilt functions to the max extent thereby reducing the complexity of the job :D
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
I think you should use any type of SQL you are comfortable with from generated to SQL builders to user defined as long as you don't transform your data within the select statement. I always try to use generated first, when it becomes too complex I move to a SQL builder, my last resort is user defined. User defined does not synchronise the SQL select list onto the output column list making it higher maintenance.
Thowing in transform functions into a select list such as renaming columns, trimming and converting data may seem like a good idea at the time but these are primary functions of an ETL tool and should be put into the ETL job. Within a custom SQL statement they are largely invisible to metadata reporting tools such as MetaStage and they place extra load onto the RDBMS engine and they are more difficult to maintain. A new developer has to know both DataStage and the SQL scripting language to debug problems.
Thowing in transform functions into a select list such as renaming columns, trimming and converting data may seem like a good idea at the time but these are primary functions of an ETL tool and should be put into the ETL job. Within a custom SQL statement they are largely invisible to metadata reporting tools such as MetaStage and they place extra load onto the RDBMS engine and they are more difficult to maintain. A new developer has to know both DataStage and the SQL scripting language to debug problems.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Re: user defined Sql query is one of the performance tunning
I'm with Vince and of the personal opinion that you're off base with the above advice.vinod raj wrote:user defined Sql query is one of the performance tunning techique in DS. It is always a better option that generated one. you can use all type of oracle or any database inbuilt functions to the max extent thereby reducing the complexity of the job :D
You don't need User Defined SQL to tune a query. It's always my technique of last choice and prefer column generated where possible. Minimize the arcane database functions you use in your SQL for precisely the reasons Vince notes.
But as I said, that's just my opinion. Different strokes...
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's really quite amazing what you can do with generated SQL if you put your mind to it. All you have to realize is:
- the Derivation column on the Columns tab becomes the SELECT clause (so you can include set functions in the derivations)
the Table name becomes the FROM clause, so you can use comma-separated lists for inner joins (or Cartesian products!) or you can include full specification of joins such as TableA LEFT OUTER JOIN TableB ON TableA.ProdCode = TableB.ProdCode
you can put whatever you like into the other, optional, clauses on the Selection tab
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.