Focal Point
[CLOSED] synonym define question

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5137098276

September 30, 2014, 09:54 AM
Rev1
[CLOSED] synonym define question
We have a bunch of procedures that are taking a long time to run. Playing with the code it appears the runtimes are being caused by defines that come from the synonym. For example we have a define in the synonym for statusdatetime_fom/YYM = hdate(statusdatetime,'YYMD'). When used as a by lowest statusdatetime_fom. The run time is over a minute. If I remove the synonym define and just put the hdate function into the by it runs in seconds. So I'm trying to understand why the define is slower and when is an acceptable time to use it?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8104, Windows, All Outputs
September 30, 2014, 10:31 AM
SWES
Hi Rev1,

The database type (Oracle, SQL, ...) might be a possible cause for this. You could try and see what happens if you put the result in a HOLD file first and then sort the HOLD file.


WebFOCUS 8105m
Windows 7, All Outputs

Member of the Benelux Usergroup
September 30, 2014, 10:40 AM
Francis Mariani
I always turn SQL traces on when running requests against a SQL DBMS table - you get very informative messages about aggregation and whether the WebFOCUS data adapter successfully translated the WF code to SQL. Most WF functions do not get translated to SQL - therefore the data has to be retrieved and then processed by WF, this is particularly inefficient if a filter is on a defined column.

This post provides the code for a SQL trace: SQL Trace statements for SQL Server DB. I'm sure it will be helpful. Please post the messages provided by the trace commands. You can see them by running the fex in HTML format and then viewing the HTML source.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 30, 2014, 11:09 AM
Tony A
Rather use a define for this sort of date manipulation, you would be better off using a redeclaration of the existing column.

Most datetime stamp columns can be declared with an ACTUAL of DATE and then with the relevant date format you require.

In the following section of a synonym, I am guessing what your existing "statusdatetime" column is declared as, but you should understand - hopefully. Try it and trap the SQL as Francis suggests, you should find the SQL translation is OK and the run time reasonable.

Note that the ALIAS must be the column name within an SQL data source. Whilst the FIELDNAME can be anything (within reason Wink).

FIELDNAME=statusdatetime, ALIAS=statusdatetime, USAGE=HYYMDs, ACTUAL=HYYMDs, $
FIELDNAME=statusdatetime_fom, ALIAS=statusdatetime, USAGE=YYM, ACTUAL=DATE, $


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 30, 2014, 01:50 PM
Rev1
Thanks for the responses. We are SQL. Tried the redeclartion with no visible improvement. Tried just putting it to a hold with no help. Seems like the only thing that speeds it up is taking out the define field and writing the compute statement.


WebFOCUS 8104, Windows, All Outputs
September 30, 2014, 02:11 PM
Francis Mariani
What do you mean by "We are SQL"? You're using DEFINE and COMPUTE which means you're using WebFOCUS. Did you try a SQL trace?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 30, 2014, 03:27 PM
Rev1
quote:
The database type (Oracle, SQL, ...) might be a possible cause for this.

It was in response to "The database type (Oracle, SQL, ...) might be a possible cause for this.".

SQl Trace has FOC2590 Aggregation Not Done for the following reason: FOC2599 NON-SQL Segment in Hierarchy (Other Interface Present).


WebFOCUS 8104, Windows, All Outputs
September 30, 2014, 03:29 PM
Francis Mariani
quote:
FOC2599 NON-SQL Segment in Hierarchy (Other Interface Present)
There you go, that's a start. Right away there is a problem - you're joining to a non SQL table/file. that most often can be inefficient.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server