Copyright 2007, Information Builders. Slide 1 Internals of Retrieval for TABLE/TABLEF/MATCH FILE Cesare Petrizio Information Builders.

Slides:



Advertisements
Similar presentations
FOCUS to DB2 By: Meadow Heath.
Advertisements

1 Noreen Redden FOCUS Users of New England 2012 MFD_PROFILE PROFILE for Your Synonym:
Relational Efficiencies Renee Teatro June Relational Efficiencies Agenda  Optimization Overview  JOIN Scenarios  Sort Scenarios  Aggregation.
Copyright 2007, Information Builders. Slide 1 Relational Efficiencies: Part II Overview and JOIN / Sort Scenarios Renee Teatro Information Builders.
Copyright 2007, Information Builders. Slide 1 Walter Brengel Information Builders New Jersey User Forum – June 2008 FOCUS to SQL DeMystified.
Copyright 2007, Information Builders. Slide 1 Accumulation Techniques for Reporting with WebFOCUS Kyle Hachey Systems Engineer.
1 Copyright 2007, Information Builders. Slide 1 Nat Poe WebFOCUS Debugging Techniques.
Concepts of Database Management Sixth Edition
Walter F. Blood Information Builders Nashville User Forum February 23, 2012 THINKing in WEBFOCUS.
1 Reporting Internals From a Reports Point of View Renee Teatro Customer Support Services.
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
Introduction to Structured Query Language (SQL)
ACS-4902 Ron McFadyen Chapter 15 Algorithms for Query Processing and Optimization.
Access Tutorial 3 Maintaining and Querying a Database
Introduction to Query Part 2. Query Topics Joining Files Defining Result Fields Complex Record Selection Formatting Output Creating Reports Using Multiple.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Enhancements to the GROUP BY Clause Fresher Learning Program January, 2012.
Database Programming Sections 5– GROUP BY, HAVING clauses, Rollup & Cube Operations, Grouping Set, Set Operations 11/2/10.
“You Asked For It, You Got It!” Best New [Backend ] Features of WebFOCUS Renee Teatro Information Builders December 2011.
1 JOIN: Rules, Roles, and Conventions Floria Foote June 2008.
Copyright 2007, Information Builders. Slide 1 JOIN, MATCH and MORE– Making the Connections Walter F. Blood Technical Director, FOCUS Division May, 2011.
Copyright 2007, Information Builders. Slide 1 Tips and Techniques for FOCUS 76 Did You Know? Walter F. Blood Information Builders, Inc.
By: M.Nadeem Akhtar1 The Data Base Management System (DBMS) Ch # 09.
Chapter 3 An Introduction to Relational Databases.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
“You Asked For It, You Got It!” Best New [Backend ] Features of WebFOCUS Walter Blood Noreen Redden Joel Starkman Information Builders, Inc. August,
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
SQL/lesson 2/Slide 1 of 45 Retrieving Result Sets Objectives In this lesson, you will learn to: * Use wildcards * Use the IS NULL and IS NOT NULL keywords.
ICT Key Skills Level 3 Strategy of Achievement. Strategy Diagnose for Level 2 –Diagnostic Assessment 5 to 6 hours –Feedback to learner Verbal Immediate.
Tips n Techniques Jenny Lalik. Report Styling Enhancements for 7.7  Accordion By Row  Excel 2007 Output Format  Hide Null Across Columns  Pass dates.
 Continue queries ◦ You completed two tutorials with step-by-step instructions for creating queries in MS Access. ◦ Now must apply knowledge and skills.
Presentation © Copyright 2002, Bryan Meyers Externally Described Files Chapter 6.
1 FOCUS Internals: Part 1 Update for 7.6.x Renee Teatro FUN Conference August 2008 Internals of Retrieval for TABLE/TABLEF/MATCH FILE.
Copyright 2007, Information Builders. Slide 1 Relational Efficiencies: Part I Renee Teatro Information Builders.
Module 5 Planning for SQL Server® 2008 R2 Indexing.
Concepts of Database Management Seventh Edition
CIS 250 Advanced Computer Applications Introduction to Access.
“You Asked For It, You Got It!” Best New [Backend ] Features of WebFOCUS Walter Blood Noreen Redden Joel Starkman Information Builders, Inc. June.
Databases: An Overview Chapter 7, Exploring the Digital Domain.
Copyright 2007, Information Builders. Slide 1 JOIN, MATCH and MORE– Making the Connections Walter F. Blood Technical Director, FOCUS Division June, 2009.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
A Guide to SQL, Seventh Edition. Objectives Understand how to use functions in queries Use the UPPER and LOWER functions with character data Use the ROUND.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
1 The Master That Tells All Floria Foote Information Builders June 2008.
Copyright 2007, Information Builders. Slide 1 FOCUS Internals: Part 2 Update for 7.6.x Renee Teatro FUN Conference August 2008 Internals of Output Processing.
Copyright © 2004, Oracle. All rights reserved. Lecture 4: 1-Retrieving Data Using the SQL SELECT Statement 2-Restricting and Sorting Data Lecture 4: 1-Retrieving.
The Advantage Series © 2004 The McGraw-Hill Companies, Inc. All rights reserved Creating Select Queries Chapter 6 Microsoft Office Access 2003.
Copyright 2007, Information Builders. Slide 1 Hidden Gems Walter F. Blood Technical Director Information Builders, Inc.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
JOIN Syntax and Techniques Noreen Redden Information Builders Copyright 2011, Information Builders. Slide 1.
Session 9 Accessing Data from a Database. RDBMS and Data Management/ Session 9/2 of 34 Session Objectives Describe the SELECT statement, its syntax and.
Copyright 2007, Information Builders. Slide 1 TABLE FILE: The Basics Noreen Redden FOCWizard June, 2008.
Copyright 2007, Information Builders. Slide 1 Cesare Petrizio June, 2008 The File Is Too Large.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Simple Queries DBS301 – Week 1. Objectives Basic SELECT statement Computed columns Aliases Concatenation operator Use of DISTINCT to eliminate duplicates.
Tarik Booker CS 122. What we will cover… Tables (review) SELECT statement DISTINCT, Calculated Columns FROM Single tables (for now…) WHERE Date clauses,
1 Copyright © 2009, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
1 ORACLE I 3 – SQL 1 Salim Phone: YM: talim_bansal.
Retrieving Data Using the SQL SELECT Statement
Writing Basic SQL SELECT Statements
What Happens When You Run A Report
SQL DATA CONSTRAINTS.
Reporting Aggregated Data Using the Group Functions
Section 4 - Sorting/Functions
Reporting Aggregated Data Using the Group Functions
Reporting Aggregated Data Using the Group Functions
Presentation transcript:

Copyright 2007, Information Builders. Slide 1 Internals of Retrieval for TABLE/TABLEF/MATCH FILE Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 2  Author: Cesare Petrizio  Company: Information Builders  Presentation Title: Internals of Retrieval for TABLE/TABLEF/MATCH FILE  Abstract: This presentation looks at what FOCUS is doing under the covers when a TABLE is executed in FOCUS on any platform, or through WEBFOCUS. Application developers can create more efficient requests when they understand how FOCUS sets up to retrieve data from FOCUS files, Relational TABLEs, and other non-FOCUS data sources. Learn the answers to such questions as: When would an index be more efficient? One pass or two? DEFINE vs. COMPUTE? What is AUTOPATH and AUTOINDEX, and what do they mean in terms of efficiency? Presentation Information

Copyright 2007, Information Builders. Slide 3 Agenda  Reporting Internals  Retrieval Internals  Analysis Phase  Retrieval Phase  Internal Matrix Generation

Copyright 2007, Information Builders. Slide 4 Retrieval Internals Retrieve DEFINE Screening FOCUS or External Sort Aggregation COUNT/MIN/MAX TOTAL Screens COMPUTE Format Extracts Analysis Report Generator Sort File Output Generator RETYPE REPLOT HOLD

Copyright 2007, Information Builders. Slide 5 FILE=EMPLOYEE,SUFFIX=FOC SEGNAME=SEG1,SEGTYPE=S1 FIELD=EMP_ID, EID,A9,$ FIELD=FIRST_NAME, FN,A15,$ FIELD=LAST_NAME, LN,A15,$ SEGNAME=INSSEG,SEGTYPE=SH2 FIELD=COVER_DT,,YMD,$ FIELD=TYPE_COVER,,A3,$ FIELD=FAMILY,,A1,$ Retrieval Internals The Files FILE=KIDS,SUFFIX=DB2 SEGNAME=SEGK,SEGTYPE=S2 FIELD=EMP_ID, EID,A9,$ FIELD=CHILD_DOB,,YYMD,$ FIELD=CHILD_NAME,,A20,$ FILE=SPICE,SUFFIX=FOC SEGNAME=SEGS,SEGTYPE=S1 FIELD=EMP_ID, EID, A9, INDEX=I,$ FIELD=SPOUSE,SPOUSE_NME,A20,$

Copyright 2007, Information Builders. Slide 6 Retrieval Internals Example SH2 KU K EMP_ID SPOUSE JOIN EMP_ID IN EMPLOYEE TO EMP_ID IN SPICE AS AJ EMP_ID FIRST_NAME LAST_NAME COVER_DT TYPE_COVER FAMILY JOIN EMP_ID IN EMPLOYEE TO ALL EMP_ID IN KIDS AS BJ EMP_ID CHILD_DOB CHILD_NAME K KM

Copyright 2007, Information Builders. Slide 7 DEFINE  Segment is determined by:  WITH field  Fields used in expression  Constant expressions are evaluated when file is opened (segment 0)  DEFINEs are evaluated ONLY if required by request  DEFINEs are evaluated at detail level only n Each DEFINE field is associated with a specific segment

Copyright 2007, Information Builders. Slide 8 Analysis n Verify DBA access to file(s) n Determine I/O access modules required n Retrieve DEFINE field expressions for pertinent files n Read and parse the request n Check DBA and set up access restrictions at SEGMENT and FIELD levels n Open and CHECK Master File Descriptions

Copyright 2007, Information Builders. Slide 9 Analysis n Activate fields (real and DEFINEd) n Read USE list and/or check Access Files and FILEDEF/ALLOCATES n Open and Verify files n Activate segments: referenced subtree(s) – smallest subtree which contains “root” and every segment referenced directly or indirectly (HEADING PARENT AND GRAND CHILD)

Copyright 2007, Information Builders. Slide 10 Retrieval Internals The Files SEG1 01 S1 ************** *EMP_ID ** *FIRST_NAME ** *LAST_NAME ** * ** *************** ************** I I I INSSEG 02 I SH2 ************** *COVER_DT ** *TYPE_COVER ** *FAMILY ** * ** *************** ************** SEGK 01 S2 ************** *EMP_ID ** *CHILD_DOB ** *CHILD_NAME ** * ** *************** ************** SEGS 01 S1 ************** *EMP_ID **I *SPOUSE ** * ** *************** ************** KIDSEMPLOYEE SPICE

Copyright 2007, Information Builders. Slide 11 SEG1 01 S1 ************** *EMP_ID ** *FIRST_NAME ** *LAST_NAME ** * ** *************** ************** I I I I I SEGS I SEGK I INSSEG 02 I KU 03 I KM 04 I SH ************** :EMP_ID :K :EMP_ID ::K *COVER_DT ** :SPOUSE : :CHILD_DOB :: *TYPE_COVER ** : : :CHILD_NAME :: *FAMILY ** : : : :: * ** : : : :: *************** JOINED SPICE : ************** JOINED KIDS Retrieval Internals JOIN EMP_ID IN EMPLOYEE TO EMP_ID IN SPICE AS J1 SEG1 01 S1 ************** *EMP_ID ** *FIRST_NAME ** *LAST_NAME ** * ** *************** ************** I I I I SEGS I INSSEG 02 I KU 03 I SH ************** :EMP_ID :K *COVER_DT ** :SPOUSE : *TYPE_COVER ** : : *FAMILY ** : : * ** : : *************** JOINED SPICE ************** JOIN EMP_ID IN EMPLOYEE TO ALL EMP_ID IN KIDS AS J2

Copyright 2007, Information Builders. Slide 12 Retrieval Internals DEFINE FILE EMPLOYEE INS_TYPE/A6 = DECODE TYPE_COVER( DDS 'DENTAL' EYE 'VISION' MDS 'HEALTH' ELSE 'OTHER'); TODAY/YYMD = '&YYMD'; AGE/I3 = (TODAY - CHILD_DOB) / ; END TABLE FILE EMPLOYEE PRINT INS_TYPE CHILD_NAME AGE BY LAST_NAME BY FIRST_NAME BY SPOUSE IF AGE LE 20 END Seg 4Define Based on TYPE_COVER Seg 0 Define (No Reference) Seg 3Define Based on CHILD_DOB

Copyright 2007, Information Builders. Slide 13 SEG1 01 S1 ************** *EMP_ID ** *FIRST_NAME ** *LAST_NAME ** * ** *************** ************** I I I I I SEGS I SEGK I INSSEG 02 I KU 03 I KM 04 I SH ************** :EMP_ID :K :EMP_ID ::K *COVER_DT ** :SPOUSE : :CHILD_DOB :: *TYPE_COVER ** : : :CHILD_NAME :: *FAMILY ** : : : :: * ** : : : :: *************** JOINED SPICE : ************** JOINED KIDS Retrieval Internals Segment Activation TABLE FILE EMPLOYEE PRINT INS_TYPE CHILD_NAME AGE BY LAST_NAME BY FIRST_NAME BY SPOUSE IF AGE LE 20 END Seg 1 Activated by FIRST_NAME and LASTNAME Seg 2 Activated by SPOUSE Seg 3 Activated by CHILD_DOB and CHILD_NAME Seg 4 Activated by TYPE_COVER Via INS_TYPE DEFINE

Copyright 2007, Information Builders. Slide 14 Retrieval Internals Field Activation  Fields Mentioned in the Body of TABLE are ACTIVATED  FIRST_NAME  LASTNAME  SPOUSE  CHILD_NAME  CHILD_DOB (Via AGE DEFINE)  TYPE_COVER (Via INS_TYPE DEFINE) DEFINE FILE EMPLOYEE INS_TYPE/A6 = DECODE TYPE_COVER( DDS 'DENTAL' EYE 'VISION' MDS 'HEALTH' ELSE 'OTHER'); TODAY/YYMD = '&YYMD'; AGE/I3 = (TODAY - CHILD_DOB) / ; END TABLE FILE EMPLOYEE PRINT INS_TYPE CHILD_NAME AGE BY LAST_NAME BY FIRST_NAME BY SPOUSE IF AGE LE 20 END

Copyright 2007, Information Builders. Slide 15 Retrieval  Unique segments are promoted into path of parent and are never missing  IF/WHERE tests on database fields are evaluated upon retrieval  DEFINE fields are evaluated if needed  IF/WHERE tests are evaluated on DEFINE fields on segment by segment basis, AFTER all other selection tests are passed  Each Path is processed independently, and fields are merged on common sort fields n Retrieval is “Top Down, Left Right” within the referenced sub-tree

Copyright 2007, Information Builders. Slide 16 Retrieval Order of Retrieval – FOCUS Files  Root segment instances are obtained in physical order  Lower level instances obtained in SEGTYPE order within parent segment  TABLEF  Root and child segment instances are obtained in SEGTYPE order  No sorting n TABLE/GRAPH/MATCH

Copyright 2007, Information Builders. Slide 17 Retrieval Order of Retrieval – FOCUS Files  Fieldname is not indexed  Segment containing “fieldname” becomes ROOT of the view, and is retrieved physically  Fieldname is indexed  Segment containing “fieldname” is accessed via the equality test on INDEX  Other segments become children of the new root segment  TABLE FILE filename.fieldname

Copyright 2007, Information Builders. Slide 18 Retrieval Order of Retrieval – FOCUS Files  Alternate Physical View is created through the referenced segment highest in the hierarchy  AUTOINDEX=ON  Alternate Indexed View is created if there is an Equality test specified for an indexed field on the referenced segment highest in the hierarchy nAUTOPATH = ON

Copyright 2007, Information Builders. Slide 19 Retrieval Autostrategy – FOCUS Files  Equality IF/WHERE test on primary key field in logically retrieved segment will terminate “chain chasing” as soon as possible STATE DATE

Copyright 2007, Information Builders. Slide 20 Retrieval Autostrategy – FOCUS Files IL MI WHERE DATE EQ ‘9912’ 1 STATE=IL,DATE=0002Continue Search 2 STATE=IL, DATE=0001Continue Search 3 STATE=IL, DATE=9912Continue Search 4 STATE=IL, DATE=9911Next Parent 5 STATE=MI, DATE=9911Next Parent

Copyright 2007, Information Builders. Slide 21 Retrieval FIXRETRIEVE – SUFFIX=FIX  Equality IF/WHERE test on primary specified sort field in single segment FIX file will terminate retrieval as soon as possible FILE=TESTFI,SUFFIX=FIX SEGNAME=TESTSEG,SEGTYPE=S1 FIELD=COUNTRY,E01,A10,A10,$ FIELD=CAR,E02,A16,A16,$

Copyright 2007, Information Builders. Slide 22 FIXRETRIEVAL ENGLAND JAGUAR ENGLAND JENSEN ENGLAND TRIUMPH FRANCE PEUGEOT ITALY AUDI WHERE COUNTRY EQ ‘FRANCE’ Retrieval stops if: Set FIXRETRIEVAL = ON

Copyright 2007, Information Builders. Slide 23 Retrieval Multiple Paths  Unique segments are always in the path of their parent  Unique segments are SEGTYPE = U, KU, DKU, KLU  JOIN TO creates DKU segments  JOIN TO ALL creates DKM segments  TABLE/MATCH/GRAPH  Instances from each path will be merged in the sort process by the common parent(s)  TABLEF does not merge data from multiple paths  Alternate file views can be used to create single paths  SET MULTIPATH controls multiple path retrieval n Retrieval is performed for each path separately

Copyright 2007, Information Builders. Slide 24 Multiple Paths ARRIVE_TIME ARR_FLIGHT ARR_FROM DEPART_TIME DEP_FLIGHT DEPART_TO Airport

Copyright 2007, Information Builders. Slide 25 Multiple Paths DEFINE FILE AIRPORTS.ARRIVE_TIME DELAY=DEPART_TIME – ARRIVE_TIME; END TABLE FILE AIRPORTS.ARRIVE_TIME PRINT DEP_FLIGHT DEPART_TIME WHERE AIRPORT EQ ‘O’’HARE’ WHERE DELAY GT 60 WHERE DEPART_TO EQ ‘LAX’ WHERE ARR_FROM EQ ‘TOR’ END ARRIVE_TIME ARR_FLIGHT ARR_FROM DEPART_TIME DEP_FLIGHT DEPART_TO Airport

Copyright 2007, Information Builders. Slide 26 Multiple Paths FAMILY INVESTMENT FAMILY COLLEGE FAMILY

Copyright 2007, Information Builders. Slide 27 Retrieval Multiple Paths Instances 1 AI BM 2 BM C 3 CI D FAMILY COLLEGE FAMILY INVESTMENT

Copyright 2007, Information Builders. Slide 28 Multiple Paths TABLE FILE SAMPLE PRINT COLLEGE INVEST BY FAMILY WHERE COLLEGE EQ ‘B’ WHERE INVEST EQ ‘ I ’ END FAMILY COLLEGE INVEST B I 2 B. 3. I FAMILY COLLEGE INVEST B I SET MULTIPATH=SIMPLE SET MULTIPATH=COMPOUND

Copyright 2007, Information Builders. Slide 29 Retrieval Short Paths  High level segments with missing referenced descendents rejected (short path)  SET ALL=ON  High level segments with missing referenced descendents accepted (missing fails IF/WHERE tests)  SET ALL=PASS  High level segments with qualified or missing referenced descendents accepted (missing passes IF/WHERE tests)  Valid only for FOCUS files n SET ALL=OFF

Copyright 2007, Information Builders. Slide 30 AB 2 C 21 &ALL &IF RESULT ONA 1,A 2, B.,C 2 &ALL &IF RESULT OFF A 1, A 2, C 2 AB 2 C 21 &ALL &IF RESULT ON SSN EQ 1 A 1 AB 2 C 21 Retrieval Short Paths SET ALL = &ALL TABLE FILE DEPTS PRINT * &IF END DEPT SSN SEX LNAME IIII &ALL &IF RESULT PASS SSN EQ 1A 1,B. AB 2 C 21

Copyright 2007, Information Builders. Slide 31 AB 2 C 21 DEPT SSN SEX LNAME IIII AB 2 C 21 Retrieval Short Paths SET ALL=PASS TABLE FILE DEPTS PRINT DEPT SSN WHERE SSN EQ 1 AND SSN EQ 2 END

Copyright 2007, Information Builders. Slide 32 Retrieval Short Paths  Referenced, not present, Unique Segments are defaulted to blanks for alpha fields, zeros for numerics  Unique segments do not create short paths. Therefore, ALL settings are irrelevant for Unique segments.  Note: Missing referenced descendents of missing unique segments revert to ALL=OFF logic  Unique segments (U, KU, DKU, and KLU) are never considered missing

Copyright 2007, Information Builders. Slide 33 Retrieval – Short Paths DEPT SSN SEX LNAME IIII AB C C1C1 A2A2 A1A1 JOIN DEPT IN DEPT1 TO DEPT IN SSNS AS AJ TABLE FILE DEPT1 PRINT DEPT WHERE DEPT1.DEPT NE SSNS.DEPT END AB C C1C1 A2A2 A1A1

Copyright 2007, Information Builders. Slide 34 Internal Matrix Generation  One row for each distinct combination of sort keys  One column for each verb object  Computed columns, row and column totals, subtotals, and summaries are not yet done  All data is in internal form  The output of the SORT/MERGE phase is conceptually a matrix

Copyright 2007, Information Builders. Slide 35 Internal Matrix Generation  Fields following a verb  Fields used in COMPUTEs not previously mentioned  Fields used in HEADINGs or FOOTINGs  Fields used in SUBHEADs or SUBFOOTs, not previously mentioned  MISSING fields are not counted  Sort Fields  BY fields  ACROSS fields (used as BY at sort phase)  FOCLIST (verb is PRINT or LIST)  Verb Objects (both SUM and COUNT are calculated)

Copyright 2007, Information Builders. Slide 36 Internal Matrix Generation Multiple Verb Sets SUM SALES BY DIVISION SUM SALES BY DIVISION BY YEAR LIST SALES BY DIVISION BY YEAR n Up to 16 verbs with associated BY fields can be specified n Up to 256 verb objects may be specified

Copyright 2007, Information Builders. Slide 37 Internal Matrix Generation Multiple Verb Sets EAST210 NORTH150 SOUTH30 WEST10 SUM SALES BY DIVISION DIV SALES SUM SALES BY DIVISION BY YEAR YEAR SALES LIST SALES BY DIVISION BY YEAR FOCLIST SALES

Copyright 2007, Information Builders. Slide 38 Reporting Internals Output Processing Attend the Follow-On Session Output Processing Phase See You There!

Copyright 2007, Information Builders. Slide 39 Questions Thanks for Coming