DB2 Web Query Tips and Techniques



Similar documents
Tips and techniques to improve DB2 Web Query for i performance and productivity

DB2 Web Query: Creating Dashboards with HTML Composer and InfoAssist. Jacqueline Jansen Information Builders

UNIVERSE BEST PRACTICES. Rob Rohloff, OEM Sales Consultant

What's New in ADP Reporting?

Refresh Web Query Synonym

Microsoft SQL Server is great for storing departmental or company data. It. A Quick Guide to Report Builder In association with

SES Project v 9.0 SES/CAESAR QUERY TOOL. Running and Editing Queries. PS Query

Participant Guide RP301: Ad Hoc Business Intelligence Reporting

Reporting with Pentaho. Gabriele Pozzani

Jet Data Manager 2012 User Guide

Stellar Phoenix SQL Recovery

Two new DB2 Web Query options expand Microsoft integration As printed in the September 2009 edition of the IBM Systems Magazine

Vendor: Brio Software Product: Brio Performance Suite

Instant SQL Programming

Vendor: Crystal Decisions Product: Crystal Reports and Crystal Enterprise

INTRODUCING ORACLE APPLICATION EXPRESS. Keywords: database, Oracle, web application, forms, reports

End the Microsoft Access Chaos - Your simplified path to Oracle Application Express

Beginning C# 5.0. Databases. Vidya Vrat Agarwal. Second Edition

Toad for Data Analysts, Tips n Tricks

MOC 20461C: Querying Microsoft SQL Server. Course Overview

SQL Simple Queries. Chapter 3.1 V3.0. Napier University Dr Gordon Russell

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database 10g: Introduction to SQL

Introduction to Querying & Reporting with SQL Server

How to Create Dashboards. Published

Performance Analytics with TDSz and TCR

Enterprise Resource Planning Analysis of Business Intelligence & Emergence of Mining Objects

Oracle Database 11g: SQL Tuning Workshop

How To Use Microsoft Gpa On Microsoft Powerbook (Windows) On A Microsoft P2.1 (Windows 2.2) On An Uniden Computer (Windows 1.5) On Micro

BusinessObjects XI R2 Product Documentation Roadmap

Sisense. Product Highlights.

Building Views and Charts in Requests Introduction to Answers views and charts Creating and editing charts Performing common view tasks

Stellar Phoenix. SQL Database Repair 6.0. Installation Guide

Data Transfer Tips and Techniques

TIBCO Spotfire Metrics Modeler User s Guide. Software Release 6.0 November 2013

Access Queries (Office 2003)

Frequently Asked Questions Sage Pastel Intelligence Reporting

Wave Analytics Data Integration

Tableau Metadata Model

Report Builder. Microsoft SQL Server is great for storing departmental or company data. It is. A Quick Guide to. In association with

DbSchema Tutorial with Introduction in SQL Databases

Microsoft Dynamics NAV

UF Health SharePoint 2010 Introduction to Content Administration

BulkSMS Text Messenger Product Manual

Microsoft SharePoint Products & Technologies

REP200 Using Query Manager to Create Ad Hoc Queries

Oracle Database: SQL and PL/SQL Fundamentals NEW

Microsoft Access 3: Understanding and Creating Queries

2Creating Reports: Basic Techniques. Chapter

Oracle Database: SQL and PL/SQL Fundamentals

Release 2.1 of SAS Add-In for Microsoft Office Bringing Microsoft PowerPoint into the Mix ABSTRACT INTRODUCTION Data Access

Lost in Space? Methodology for a Guided Drill-Through Analysis Out of the Wormhole

SAP BusinessObjects Business Intelligence (BI) platform Document Version: 4.1, Support Package Report Conversion Tool Guide

Business Intelligence Tutorial

OpenIMS 4.2. Document Management Server. User manual

HansaWorld SQL Training Material

PeopleSoft Query Training

Business Portal for Microsoft Dynamics GP. Key Performance Indicators Release 10.0

DBMS / Business Intelligence, SQL Server

Oracle SQL. Course Summary. Duration. Objectives

PUBLIC Supplement for J.D. Edwards

Oracle Database 12c: Introduction to SQL Ed 1.1

Information Technology

Installing Client Profiles 6.0

ER/Studio Enterprise Portal User Guide

Course Descriptions for Focused Learning Classes

Top 10 Oracle SQL Developer Tips and Tricks

ADP Workforce Now V3.0

SAP BusinessObjects Dashboards

Excel 2007 Tutorials - Video File Attributes

Kaseya 2. Quick Start Guide. for VSA 6.3

Reporting and Analysis Using Vivid Reports Flex

MICROSOFT ACCESS 2003 TUTORIAL

Tips and Tricks SAGE ACCPAC INTELLIGENCE

Switching from PC SAS to SAS Enterprise Guide Zhengxin (Cindy) Yang, inventiv Health Clinical, Princeton, NJ

Information Design Tool User Guide SAP BusinessObjects Business Intelligence platform 4.0 Feature Pack 3

Before You Begin. SharePoint How To s / Access and Storage 1of 7

SAS BI Dashboard 4.3. User's Guide. SAS Documentation

Microsoft Office 2010: Access 2010, Excel 2010, Lync 2010 learning assets

Oracle Database: SQL and PL/SQL Fundamentals NEW

Manage. Help Documentation. This document was auto-created from web content and is subject to change at any time. Copyright (c) 2016 SmarterTools Inc.

TABLE OF CONTENTS. Features - SharePoint Server idataagent. Page 1 of 72 OVERVIEW SYSTEM REQUIREMENTS - SHAREPOINT SERVER IDATAAGENT INSTALLATION

Advanced Query for Query Developers

<Insert Picture Here> Oracle SQL Developer 3.0: Overview and New Features

Business Objects Online training Contents SAP BUSINESS OBJECTS 4.0/XI 3.1. We provide online instructor led Business Objects Training.

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

COMP 5138 Relational Database Management Systems. Week 5 : Basic SQL. Today s Agenda. Overview. Basic SQL Queries. Joins Queries

NEW FEATURES ORACLE ESSBASE STUDIO

Universe Best Practices Session Code: 806

Introduction to the Oracle DBMS

OWB Users, Enter The New ODI World

CorHousing. CorHousing provides performance indicator, risk and project management templates for the UK Social Housing sector including:

CHAPTER 7: DATABASE APPLICATIONS AND PRIVACY IMPLICATIONS

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

WEB DEVELOPMENT COURSE (PHP/ MYSQL)

Trial version of GADD Dashboards Builder

BI xpress Product Overview

Customer admin guide. UC Management Centre

Transcription:

DB2 Web Query Tips and Techniques Jackie Jansen Jackie_Jansen@ibi.com www.ibm.com/systems/i/db2/webquery Agenda Performance Compute and Define fields DB2 optimization Run w SQL Trace with example Legacy Dates Tips for working with dates InfoAssist performance tip & IE tip Recommendations for prompting parameters Joining Tables Metadata and Applications User Row/Record Security Filters and Business Views Interesting tidbits Data profiling General Tips The Forum & the WIKI Performance / Complexity versus Ease of Use / Simplicity 1

Compute vs Define (Virtual Column) Fields Define fields Compute Fields - Virtual Column - RA/GA wizard on right - RA/GA wizard on left - Executed after data is aggregated - Executed on database read - Calculated once for very print line - Calculated once for every record - Calculated after database execution DB2 Performance Recommendation ** Push as much logic as possible down to DB2 ** Use Run w/sql trace option No Run w/sql trace option for InfoAssist Create a simple Report Assistant report containing the specific function you are testing Look for database optimization disablers Use SQL views to overcome database optimization disablers Assume that our database table has 1 million records and 100 distinct dates (output summed by date) 2

Performance Example: Convert Legacy Date to Smart Date Output 100 records DB2 retrieved 1 million records Web Query then read 1 million records, summed 1 million records, output 100 records Very, very slow!! Performance Example: Convert Legacy Date to Smart Date Output 100 records DB2 processed 1 million records Web Query receives, formats and outputs 100 records Very, very fast!! Make sure you handle non date values you may have inserted in your date fields (filter out or convert to 99990101) 3

Performance Example: Summing Character Fields Performance Example: Summing Character Fields FST. or LST. where sort fields do not cover the key 4

Additional DB2 Performance Tips Maximize SQE usage - Avoid SQE Inhibitors Avoid creating metadata over DDS logical files Watch out for Select-Omit logical files against physical files (not as important in V6R1) Both the Heritage File and Query/400 adapter use CQE Use the DB2 CLI adapter if possible Recreate Query/400 reports as new reports that use synonyms based on DB2 CLI adapter No way to avoid it for multi-format files (must use Heritage File adapter) Use SQL Aliases to access multiple members Magic Bullet V1.1.1 Initially use for every report, including single table reports 9 Legacy and Smart Dates Legacy Dates An integer, packed decimal, or alphanumeric format with date edit options, such as I6YMD, A6MDY, I8MDYY, or A8YYMD In Master file indicate date format as USAGE (A8YYMD) Formatted Legacy Date (P8YYMD) 2011/04/01 Mathematically extract components SORT/BY/ACROSS optimized Filter (YEAR = InpParm) Some date arithmetic is optimized Do you need to convert to a Smart Date? Do you need to convert to a Smart Date? - Often Not - Required for: - Monday April 4, 2011 - Many date arithmetic functions (not all optimized) - Use of calendar icon through HTML Composer 5

Numeric Legacy Dates Actual: P8 P6 Usage: P8YYMD P6YMD Output: 2011/04/01 - Dates less than 6 digits use math to create 6 or 8 digit date - i.e. Year * 10000 + Mth * 100 + Day Filter: 20110101 <= Year <= 20111231 - Do not decompose Legacy date to create a filter - Do NOT filter WHERE YEAR = NumDate / 10000-2011 2011.0401 Smart Dates if required: - Must start with an 8 digit field - DATECVT(Date8Num, P8YYMD, YYMD ) - Date Components Required: - DPART(DateFld, P8YYMD, YYMD ) starting with your YYMD field Character Legacy Dates Actual: A8 A6 Usage: A8YYMD A6YMD Output: 2011/04/01 - Use (concatenate) to combine components when less than A8 Filter: - Use SUBSTR to decompose date WHERE YEAR = (SUBSTR(A8Date.)) Smart Dates: Are they required? - Must start with an 8 digit field - DATECVT(DateA8, A8YYMD, YYMD ) - Cannot currently combine Concatenate and DATECVT - For dates less than 8 characters use an SQL View for Summary reports or calendar icons or use a date dimension table 6

Legacy Date Optimization Summary 8 Long? Smart Dates Required for: - Formatting January or Friday - Optimizing many date calculations (Use COMPUTE where possible) - Using Calendar icon yes no Formatting / Year filter - num use all 8 digits, alpha use SUBSTR SmartDate: DATECVT DPART 6 Long? yes no 6 Long Alpha or Num? 4/2/2 or 2/2/2/2 or 1/2/2/2 Alpha or Num? alpha num alpha num (Alpha) Formatting / Filter: SUBSTR 8 Long: Concatenate SmartDate: Use SQL View or date dim. table for optimization (num) Use Math to make 8 long SmartDate: DATECVT DPART (Alpha) 8 Long: Concatenate Formatting / SmartDate: Use SQL View or date dim. table for for optimization (num) Use Math to make 8 long Formatting / SmartDate: DATECVT DPART Julian Dates not shown And the Tips just keep coming InfoAssist development performance IE Control key is marvelous! CTL key Tip: Reduce records sent to IE Use prompting or drill down 7

Input Parameter Alternatives Creating HTML page front-end Using HTML Composer in Developer Workbench Controls grouped and passed together rather than individually. The more parameters, the better the performance (over Auto Prompt) More efficient i techniques to build the HTML for the drop down lists Aesthetically more options and more pleasing Usage Tip Consider HTML Composer with calendar icons for date prompting Joining Tables Use DB2 Foreign Key support if possible Developer Workbench Reference existing synonyms R1.1.2 system will try to autojoin the two tables you select In reporting tool 16 8

Metadata Synonyms can be placed in application folders and associated with Domains Only members of group profile can access those synonyms Metadata will automatically go into first application in domain s application list Developers working in Developers Workbench will see the application folders under the domains that they are authorized to. Administrators only will see Data Servers containing all metadata applications Developer Administrator User Row/Record Security Alternatives Complete security including securing developers SQL Views! Join to a table containing userid and security values Allows for more complex selection Very fast: DB2 optimization and checking JJANSEN SMITH SMITH JJANSEN JONES Today a developer can simply create their own synonym and bypass secured synonyms See white paper on DB2 Web Query website DBA Store security data and information directly in synonym Optimized DB2 Details next slide Web Query Join Create table with userid and authority values Join Security table to master file with secured field (i.e. COUNTRY) Retrieve run time userid Select records where run time user equals security userid In Report, compare user to &FOCUSER &FOCUSER optimized Report developer makes security decision In Master File have to use GETUSER( 10 ) NOT optimized CANADA GERMANY UNITED STATES UNITED STATES UNITED STATES 9

DBA Jackie DEMOADMIN DEMODEV Filters and Business Views Global Filters Report designer can easily select and reuse i.e. Europe filter might automatically select all countries in Europe Modified filters automatically used by all existing reports Business Views Simplify list of columns by categorizing fields within folders Reduce fields user sees (simplicity and security) 10

More Questions More Answers 1) Question: How to display graphic indications of performance? Answer: Wingdings font with conditional styling. 2) Question: How to have a calculation at subtotal and not at detail level. Answer: Subfootings and Prefixes. 3) Question: My field length has changed. What is effected? Answer: Developer Workbench: Impact Analysis TIP: different analysis based on starting point: reports or master files Developer Workbench: Data Profiling By column / table / cluster / view Pattern count, outliers Identifies Avg, Min/Max Number of distinct Values % of Nulls 11

General Tips Multi-member file support Can use the Heritage File adapter uses OPNQRY and CQE Creating an alias will use SQE CREATE ALIAS MYLIB/MYALIAS FOR MYLIB/FILENAME (MBRNAME) SQL Wizard type or import an SQL statement Part of Developer Workbench Result set is sent to RA/GA for formatting Developer Workbench Confirm Close Use this setting Show Desktop on Explorer Tree General Tips Create Domain names with exactly eight characters and then change the displayed name in the Domain properties Consider using a Prefix for synonym names to assist in grouping related tables together Backup libraries and IFS SAVLIB QWEBQRY76 and QWEBQRY77 Sav - /QIBM/PRODDATA/WEBQUERY/IBI/* Sav - /QIBM/USERDATA/WEBQUERY/IBI/* Use style sheets to format your reports You can modify provided style sheets or create your own.sty and.css RA style sheets need copying into Other Files (redbook gives details) IA style sheets are instantly available RA/GA/PP prompt for parameter ParameterName.Prompt_Text. 12

The Forum and the WIKI IBM developerworks site for DB2 Web Query www.ibm.com/developerworks/spaces/db2webquery Registration g Recommended KnowledgeBase and Forum Links to Additional Information WIKI Repository of technical information DB2 Web Query home page www.ibm.com/systems/i/db2/webquery Getting Started with DB2 Web Query Redbook http://www.redbooks.ibm.com/abstracts/sg247214.html Download Sample Database 13