Basic Outputs to Troubleshooting Queries.

Slides:



Advertisements
Similar presentations
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you manage a database?
1 Agenda Overview Review Roles Lists Libraries Columns.
Executing Explain Plans and Explaining Execution Plans Craig Martin 01/20/2011.
DM109 A Practical Guide To ASE Optimizer Statistics and Optdiag Eric Miner Development Engineer Optimizer Group
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
Applications Software. Applications software is designed to perform specific tasks. There are three main types of application software: Applications packages.
TABLE OF CONTENTS LEARNING POWERPOINT
Software. Generic Software  e.g. word processing, spreadsheet and database. – This simply implies that any of the dozens of spreadsheet packages, for.
Performance Dash A free tool from Microsoft that provides some quick real time information about the status of your SQL Servers.
Module 16: Performing Ongoing Database Maintenance
Query Optimizer Execution Plan Cost Model Joe Chang
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
Task #1 Create a relational database on computers in computer classroom 308, using MySQL server and any client. Create the same database, using MS Access.
Analysing Indexes SQLBits 6 th October 2007 © Colin Leversuch-Roberts Kelem Consulting Limited September 2007.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
Providing the Missing Pieces by The Master's Touch.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
SQL Server Magic Buttons! What are Trace Flags and why should I care? Steinar Andersen, SQL Service Nordic AB Thanks to Thomas Kejser for peer-reviewing.
SQL Server Statistics and its relationship with Query Optimizer
Microsoft Word 2016 Lesson 6 Part 1.
Chris Index Feng Shui Chris
RFPMonkey.com Agenda Overview Logging in Personal Settings
ASE Optdiag Features including dynamic_histogram
Blue Collar SQL Tricks - Make Standard Edition Work for you.
SQL Trace and TKPROF.
Module 11: File Structure
Microsoft Excel.
15.1 – Introduction to physical-Query-plan operators
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Data Virtualization Demoette… Data Lineage Reporting
Indexing ? Why ? Need to locate the actual records on disk without having to read the entire table into memory.
Query Tuning without Production Data
Troubleshooting SQL Server When You Cannot Access The Machine
Finding more space for your tight environment
Query Tuning without Production Data
Query Tuning without Production Data
Introduction to SQL Server Management for the Non-DBA
Database Performance Tuning and Query Optimization
Programmable Logic Controllers (PLCs) An Overview.
Introduction to Execution Plans
Cardinality Estimator 2014/2016
Microsoft Excel All editions of Microsoft office.
JULIE McLAIN-HARPER LINKEDIN: JM HARPER
Statistics: What are they and How do I use them
Transactions, Locking and Query Optimisation
Reading Execution Plans Successfully
Troubleshooting Techniques(*)
Lecture 28: Index 3 B+ Trees
BUSINESS COMMUNICATION SKILLS PRESENTATION SKILLS OF THESIS & PROJECT
Dave Bland LinkedIn SQL Server Execution Plans: How to use them to find performance bottlenecks Dave Bland LinkedIn
Query Processing CSD305 Advanced Databases.
Query Execution Presented by Jiten Oswal CS 257 Chapter 15
Introduction to Execution Plans
Chapter 11 Database Performance Tuning and Query Optimization
Diving into Query Execution Plans
Query Profiling Options in SQL Server
Introduction to Execution Plans
Blue Collar SQL Tricks - Make Standard Edition Work for you.
Reading execution plans successfully
Introduction to Execution Plans
Performance Tuning for SQL Developers through Execution Plans
Performance Tuning for SQL Developers through Execution Plans
Performance Tuning for SQL Developers through Execution Plans
Performance Tuning for SQL Developers through Execution Plans
Performance Tuning for SQL Developers through Execution Plans
Performance Tuning for SQL Developers through Execution Plans
Presentation transcript:

Basic Outputs to Troubleshooting Queries. ASE Customer Coffee Corner November, 2016

Agenda Basic traces and commands for diagnostics. Isql parameters. Get familiar with the query. Missing Statistics. Lava Operator Tree or trace 9526. Showplan output. Final plan cost and Elapsed time. Set statistics i/o. Demo . Questions .

Basic traces and commands for diagnostics. select @@version // Really important to know the version select @@optlevel // be sure to be in the latest fix level ase_current select @@optgoal // The goal been used set statement_cache off // Will generate a new plan avoid using a cached plan set option show_missing_stats on // Will show missing statistics set option show brief // Shows basic diagnostics and fixes and criterias enabled set option show_abstract_plan on // Generates Abstract Plan can be used to test other plans set statistics io on // io outputs

Cont … Basic traces and commands for diagnostics. set statistics time on // time output set statistics plancost on // cost plan set plan optlevel ase_current // Set current fix level set showplan on // showplan output dbcc traceon(3604) // Enable printing diagnostics dbcc traceon(9526) // Lava Tree ( estimates vs actual values for rows, lios and pios ) dbcc traceflags //Display current trace flags

Cont … Basic traces and commands for diagnostics. set nodata on //omits data set results <query> dbcc traceoff(3604,9526) go

Isql parameters. –U<user> // user to execute the query -P<password> // password of the user -w2000 // width of the output to avoid word wrapping -e // copy commands to the output file -S<server name> // name of the server to be used -i <input file> // file to execute -o <output file> // file to collect diagnostics and traces

. Get familiar with the query. Take a look at the query. Draw a graphical representation of it . Tables. Indexes. Columns.

Missing Statistics. Look for missing statistics messages “NO STATS on column” easiest way is using “grep” command grep "NO STATS on column" <Diagnostics File> NO STATS on column #TMP_SHIPMENT.SHPMNT_ID NO STATS on column SHIPMENT_DTL.SHPMNT_DTL_ID NO STATS on column SHIPMENT_DTL.SHPMNT_ID NO STATS on column SHPMNT_DTL_BARCD_X_REF.SHPMNT_DTL_ID

Lava Operator Tree or trace 9526. Lava Operator Tree or trace 9526 output is very important. Shows both estimates and actual values for rows, Lios and Pios. Large differences between “act” and “est” usually are signs for inaccurate or lack of statistics. As shown below each node shows its individual values.

Cont .. Lava Operator Tree or trace 9526. |Emit (VA = 20, LSTATE_CLOSED) | Rows: act:362 est:9.808e+06 | |Sequencer (VA = 19, LSTATE_CLOSED) | | Rows: act:362 est:0 | | |StoreIndex (VA = 2, LSTATE_CLOSED) | | | Rows: act:87 est:100 | | | Lios: act:11 est:6 | | | Pios: act:2 est:0 | | | cpu: 100 bufct: 24

Showplan output. STEP 1 The type of query is SELECT. 20 operator(s) under root |ROOT:EMIT Operator (VA = 20) | | |SEQUENCER Operator (VA = 19) has 2 children. | | | | |STORE Operator (VA = 2) | | | Worktable1 created, in allpages locking mode, for REFORMATTING. | | | Creating clustered index. | | | | | | |INSERT Operator (VA = 1) | | | | The update mode is direct. | | | | | | | | |SCAN Operator (VA = 0) | | | | | FROM TABLE | | | | | #TMP_SHIPMENT | | | | | T | | | | | Table Scan. | | | | | Forward Scan. | | | | | Positioning at start of table. | | | | | Using I/O Size 2 Kbytes for data pages. | | | | | With LRU Buffer Replacement Strategy for data pages. | | | | TO TABLE | | | | Worktable1.

Final plan cost and Elapsed time. FINAL PLAN ( total cost = 2.317187e+08 ): lio=8516448 pio=8516444 cpu=1.774662e+07 tempdb=6228.525 Adaptive Server cpu time: 3000 ms. Adaptive Server elapsed time: 4886 ms.

Set statistics i/o. Table: SHPMNT_DTL_BARCD_X_REF (X) scan count 1690, logical reads: (regular=3454 apf=0 total=3454), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 Table: SHIPMENT_DTL (D) scan count 1735, logical reads: (regular=4724 apf=0 total=4724),

Document Links Documentation: SAP® Adaptive Server® Enterprise Performance and Tuning Series

Live Demo

Thank you Feel free to email questions, ideas, or comments to: sap-psglobalaseccc@sap.com

Preparing Your Slides Let visuals guide your audience. Avoid writing script on the slide. Check spelling with Presentation Wizard Presentation duration? 1 hour or less, no more than 30 slides. 10 Font size of at least 10 An agenda is required

Speaking Tips Don’t read straight from your notes! Pronounce your words as clearly as possible Non-native listeners will appreciate it!

Prepping the Deck – Writing Style Words in English are typically written lowercase. Exceptions: headlines, nations, names of places … Your text should be short and digestible. Use only SAP approved names, and use the full term when first mentioned. After having already mentioned the entire name, you may abbreviate. “SAPanese” also requires explanation.