ASE Optdiag Features including dynamic_histogram

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

CC SQL Utilities.
Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Working with SQL Server Database Objects
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Automating Tasks With Macros
Introduction to Structured Query Language (SQL)
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Creating Web Page Forms
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
SQL Server 2005 SP2 Israeli SQL Server User Group March 2005 Ami Levin
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Backup & Recovery 1.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 5: Setting Up Global Accessibility.
DM109 A Practical Guide To ASE Optimizer Statistics and Optdiag Eric Miner Development Engineer Optimizer Group
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
LOGO 1 Lab_02: Basic SQL. 2 Outline  Database Tables  SQL Statements  Semicolon after SQL Statements?  SQL DML and DDL  SQL SELECT Statement  SQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Architecture Rajesh. Components of Database Engine.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
Module 16: Performing Ongoing Database Maintenance
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
1 Chapter 13 Parallel SQL. 2 Understanding Parallel SQL Enables a SQL statement to be: – Split into multiple threads – Each thread processed simultaneously.
8 Copyright © 2005, Oracle. All rights reserved. Gathering Statistics.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
SQL Triggers, Functions & Stored Procedures Programming Operations.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP,MCP. SQL SERVER Database Administration.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP SQL SERVER Database Administration.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
©NIIT BCP and DTS Implementing Stored Procedures Lesson 2A / Slide 1 of 23 Objectives In this lesson, you will learn to: Perform bulk copy using the BCP.
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.
2 Copyright © 2008, Oracle. All rights reserved. Building the Physical Layer of a Repository.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Basic Outputs to Troubleshooting Queries.
SQL Server Statistics and its relationship with Query Optimizer
Controlling User Access
Data Virtualization Demoette… Logging in CIS
Helping Yourself in PD2 SPS Spotlight Series July 2015.
Data Virtualization Demoette… Caching – Database – Multi Table
Temporal Databases Microsoft SQL Server 2016
SQL Trace and TKPROF.
SQL and SQL*Plus Interaction
Using SQL*Plus.
SQL Implementation & Administration
Query Tuning without Production Data
Core LIMS Training: Advanced Administration
Using SQL*Plus.
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
Chapter Four UNIX File Processing.
8 6 MySQL Special Topics A Guide to MySQL.
Environmental Monitoring: Coupling Function Calculator
Lecture 5: Functions and Parameters
Using SQL*Plus.
Presentation transcript:

ASE Optdiag Features including dynamic_histogram ASE Customer Coffee Corner Sept, 2016

Agenda What is optdiag ? Using simulated statistics for an SAP incident Syntax for optdiag Other tools related to optdiag What is new with statistics in ASE 16 SP 01? Document Links Live Demo

What is optdiag? The optdiag utility displays statistics from the systabstats and sysstatistics tables. It can be used to update sysstatistics information. Only a system administrator can run optdiag. Using optdiag to alter statistics can improve the performance of some queries. Note: optdiag overwrites existing information in the system tables, which can affect all queries for a given table. After you change statistics using optdiag: running create index or update statistics overwrites the changes. The commands succeed,  but prints a warning message like: WARNING: Edited statistics are overwritten. Table: ’titles’ (objectid 208003772), column: ’type’.

What is optdiag? (CONTINUED) If you load statistics without simulate mode, be prepared to restore the statistics, if necessary, either by using an untouched copy of optdiag output or by re-running update statistics. You can use optdiag output from a 32-bit SAP ASE to change statistics in another 32-bit SAP ASE, but not a 64-bit SAP ASE. Similarly, do not use optdiag output from a 64-bit SAP ASE as input to a 32-bit SAP ASE.

Using simulated statistics for an SAP incident When sending a query performance incident to SAP generally you are requested to send: “simulate statistics” along with complete ddls for all tables in the query ddl’s include: tables, indexes, partitions, and named caches. optdiag can generate statistics that can be used to simulate a user environment without requiring a copy of the table data. This permits analysis of query optimization using a very small, or empty database. For example, you can use simulated statistics to: Help Technical Support replicate optimizer problems Perform “what-if” analyses to plan configuration changes Perform diagnostics on a development server. You can also load simulated statistics into the database from which they were copied. Simulated statistics are loaded into the system tables with IDs that distinguish them from actual table data. The ’set statistics simulate on’ command instructs the server to optimize queries using the simulated statistics, rather than the actual statistics.

Syntax optdiag? The syntax for optdiag is: optdiag [binary] [simulate] statistics {-i <input_file> | <database>[.<owner>[.<table>[.<partition> [.<column>]]]] [-o <output_file>]} [-U <user_name>] [-P <password>] [-I <interfaces_file>] [-S <server>] [-v] [-h] [-s] [-T <flag_value>] [-z <language>] [-J <client_charset>] [-a <display_charset>] [using dynamic_histogram [ on | off ] To display statistics for all user tables in the pubs2 database, placing the output in the pubs2.opt file, use: optdiag simulate statistics pubs2 -Usa -Ppasswd -o pubs2.opt To display statistics for the titles table and for any indexes on the table, use: optdiag simulate statistics pubs2..titles -Usa -Ppasswd -o AAAI.opt

Other tools related to optdiag sp_showoptstats SAP ASE includes sp_showoptstats, which functions like the optdiag standalone utility, extracting and showing, in an XML document, statistics and histograms for various types of data objects from system tables such as systabstats and sysstatistics. The syntax is: sp_showoptstats [<dbname>[.<owner>[.[<table_name>] ] ] ], [.<column>], [<option>]

Other tools related to optdiag (continued) sp_flushstats sp_flushstats explicitly flushes the in-memory statistics for a specific table to systabstats (these statistics are things like the row count, cluster ratio information, etc.; not the histogram & density information generated by  update statistics). This flushing is normally done automatically by the housekeeper task, but in case the housekeeper is disabled, you can force the data to be flushed. Use sp_flushstats first to ensure that the most recent statistics are available. optdiag flushes statistics to disk before displaying values. sp_modifystats sp_modifystats allows you to manipulate the density statistics in sysstatistics, which were generated by update statistics.  Using this procedure makes sense only when you have a very good understanding of the ins and outs of the ASE query optimizer.

What is new with statistics in ASE 16 SP 01? Dynamic histograms: Dynamic histograms allow you to specify columns for which a new range cell is dynamically maintained at the end of an existing histogram. For DML operations on this column, the new range cell includes the maximum value and dynamically maintains a row count. The boundaries of the original cells of the histogram remain unchanged, but the weights of the original cells are proportionally decreased as the weight of the new cell is increased. The syntax to enable dynamic histograms is: update statistics <table_name> (<column_name>, ...) ... [using dynamic_histogram [ on | off ]

What is new with statistics in ASE 16 SP 01? (continued) You must set the configuration for “sysstatistics flush interval” to a value greater than zero sp_configure “sysstatistics flush interval”, 20 The default is zero Traceflag 12806 for example: dbcc traceon (3604, 12806) Print diagnostic trace on UPDATE STATISTICS and DML commands.

Document Links References: 2167102 - Performance is slow for a query using in-between statement (range predicate) – ASE 1929560 - How to determine if REORG should be run from optdiag output in ASE? 2243932 - Table scan is chosen if local variable is used as a search argument and the query performance slows down. - SAP ASE 1988269 - How to collect diagnostic information for a query performance problem for ASE15.0 Documentation: Performance and Tuning Series: Improving Performance with Statistical Analysis Changing Statistics with optdiag Using Simulated Statistics Viewing Statistics and Histograms Using sp_showoptstats optdiag Syntax for Simulated Statistics Using Dynamic Histograms

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.