As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a report that runs within 30 seconds when I select a single Period 'yyyymm', but if I try to run a range of periods like 3 periods it takes 10 minutes to run. Now now... I do expect the answer to be 'YOU NEED TO KNOW HOW TO PROGRAM BETTER'. But sh$%#$ the only difference is a range.
****THE REEAALLYY SLOW CODE: JOIN INNER BPDETFOC.SEG01.GRP IN BPDETFOC TO UNIQUE PGRPFOC.SEG01.KEY IN PGRPFOC AS J0 END JOIN INNER BPDETFOC.SEG01.PLANT IN BPDETFOC TO UNIQUE LOCFOC.SEG01.LOCATION_KEY IN LOCFOC AS J1 END JOIN INNER LOCFOC.SEG01.LOCATION_KEY IN BPDETFOC TO UNIQUE BUSFOC.SEG01.BUSINESS_KEY IN BUSFOC AS J2 END JOIN INNER BPDETFOC.SEG01.COMPANY IN BPDETFOC TO UNIQUE COMPFOC.SEG01.COMPANY_CODE IN COMPFOC AS J3 END -* DEFINE FILE BPDETFOC COMPANY/A32 = COMPFOC.SEG01.COMPANY_CODE | ' - ' | COMPFOC.SEG01.COMPANY_DESCRIPTION; YRMO/YYM=BPDETFOC.SEG01.DATE; END SET ASNAMES = ON TABLE FILE BPDETFOC PRINT 'BUSFOC.SEG01.CORPORATE' 'BUSFOC.SEG01.DIVISION' 'BUSFOC.SEG01.BUSINESS' 'BUSFOC.SEG01.PLANT_NAME_FOR_DASHBOARD' AS 'BUS_PLANT_NAME' 'LOCFOC.SEG01.REGION' 'LOCFOC.SEG01.COUNTRY' AS 'LOC_COUNTRY' 'LOCFOC.SEG01.AREA' 'LOCFOC.SEG01.PLANT_NAME_FOR_DASHBOARD' AS 'LOC_PLANT_NAME' 'COMPFOC.SEG01.COMPANY' 'COMPFOC.SEG01.COUNTRY' AS 'COM_COUNTRY' 'BPDETFOC.SEG01.HEADER_TEXT' 'BPDETFOC.SEG01.VENDOR' 'BPDETFOC.SEG01.VENDOR_INDUSTRY' 'BPDETFOC.SEG01.DESCRIPTION' 'BPDETFOC.SEG01.DOC_NUMBER' 'BPDETFOC.SEG01.DATE' 'BPDETFOC.SEG01.AMOUNT' 'BPDETFOC.SEG01.AMOUNT_CURRENCY' 'BPDETFOC.SEG01.BLOCKED_PRICE' 'BPDETFOC.SEG01.BLOCKED_QUANTITY' 'BPDETFOC.SEG01.BLOCKED_DATE' 'BPDETFOC.SEG01.INVOICE_DATE' 'BPDETFOC.SEG01.ENTRY_DATE' 'BPDETFOC.SEG01.DUE_DATE' 'PGRPFOC.SEG01.NAME' -*---------------------------------------- -IF &RPTTYPE EQ 'PRK' THEN GOTO PARKED; WHERE BPDETFOC.SEG01.BLK EQ 'X'; -GOTO ENDPRKBLK; -* -PARKED WHERE BPDETFOC.SEG01.PRK EQ 'X'; -ENDPRKBLK -*---------------------------------------- WHERE YRMO GE &YRMO_START AND YRMO LE &YRMO_END; <<<******* MY CHANGE
****THE REALLY FAST CODE IS*****
WHERE YRMO EQ &YRMO;This message has been edited. Last edited by: Kerry,
Version of Webfocus = 766 Platform = Windows wish to use all possible output formats.
Firstly, on your last report, do a COUNT * WHERE range-condition to see how many rows you are trying to bring back. The more rows, the longer it takes.
Secondly, it wouldn't hurt to trace your program and check out the generated SQL.
SET TRACEOFF = ALL
SET TRACEON = SQLAGGR//CLIENT
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACESTAMP = OFF
SET TRACEWRAP = 78
SET TRACEUSER = ON
SET XRETRIEVAL=OFF
The XRETRIEVAL will keep the program from running and just parse the SQL. If you get more than one SQL statement or a FOCUS-managed join, etc., that will be where your problem is. Please post your results.
Or is this a FOCUS file? If yes, please post your master. You might be screening on a low-level segment.
The problem is that the index on DATE cannot be used because the WHERE clause references a DEFINEd portion of DATE. Try manipulting your start and end variables so they include a complete YYMD date and change your WHERE clause to test against those complete dates.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
You have two DM variables with the starting and ending dates. I would append 01 to them to create proper YYMD dates and use them in the WHERE statement. I avoid DEFINE based WHERE statements as much as possible.
-SET &YYMD_START = &YRMO_START | '01';
-SET &YYMD_END = &YRMO_END | '01';
WHERE BPDETFOC.SEG01.DATE GE &YYMD_START AND BPDETFOC.SEG01.DATE LT &YYMD_END;
(Note the LT instead of the LE)
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