Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic Outputs to Troubleshooting Queries.

Similar presentations


Presentation on theme: "Basic Outputs to Troubleshooting Queries."— Presentation transcript:

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

2 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 .

3 Basic traces and commands for diagnostics.
select // Really important to know the version select // be sure to be in the latest fix level ase_current select // 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

4 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

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

6 Isql parameters. –U<user> // user to execute the query
-P<password> // password of the user -w // 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

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

8 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

9 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.

10 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

11 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.

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

13 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),

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

15 Live Demo

16 Thank you Feel free to email questions, ideas, or comments to:

17

18

19 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

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

21 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.


Download ppt "Basic Outputs to Troubleshooting Queries."

Similar presentations


Ads by Google