SQL query or explicit stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

SQL query or explicit stage

Post by sharmabhavesh »

Hi,
I have data in a source table. I want to group the data based on a field.
Should I use SQL query inside my source table stage or shall I use an agreegator stage. Which one is a better option and why?

Thanks in advance :).
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Try both ways and then you know.

All down to complexity of query, loads on each server, size of each server etc etc
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the field indexed in the database?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

In stage query or explicit stage

Post by sharmabhavesh »

Hi Ray,
There's no indexing in the table.
Right now, sample data I have has very low number of records so I am not able to find out any difference in time by both the methods.
But in production, there would be huge amount of data and that's why I want to know which one would work better?
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

It is almost impossible to answer this question not knowing the particular task and data.

If SQL-grouping will reduce the number of records selected drastically and the database is not too weak on resources, I would probably opt for that. If not I would expect DataStage to be faster in many circumstances.

But as KrytOn said: the answer depends on many factors...
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
Post Reply