Socrates,
My goodness. This is a huge topic to cover in a small amount of space. There are a lot of issues and I'm going to point you to some documentation. Since you are registered on this IBI site, go to the Advanced Search option that you see when you first log onto the tech support site. Type in RDBMS optimization and you should see a topic about optimizing joins.
RDMBS optimization varies with the data source. For instance more stuff is passed if the request is to DB2 than to Teradata for instance. Lots of things turn off optimization, like the SET ALL parameter.
If you could provide your code and the masters and the data source type, that would be helpful.
Assuming you are using TABLE and not passthru, you can put the trace commands below at the beginning of your program to trace it. Make sure the output format is HTML and when you get your empty report, right-click, View Source, scroll down to the bottom and then post the results of the trace here. I'll be able to tell what is going on. I do a lot of this with my users so I have a bit of experience.
Here are the trace commands:
SET TRACEOFF = ALL
SET TRACEON = SQLAGGR//CLIENT
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
SET XRETRIEVAL=OFF
Note that the last command traces the code but does not retrieve data.
Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google