About this book

Audience

This manual is intended for database administrators, database designers, developers and system administrators.

NoteYou may want to use your own database for testing changes and queries. Take a snapshot of the database in question and set it up on a test machine.

How to use this book

This manual is used to fine tune, troubleshoot or improve the performance on Adaptive Server.

Chapter 1, “Introduction to Performance and Tuning” gives a general description of this manual and the other manuals within the Performance and Tuning Series for Adaptive Server.

Chapter 2, “Optimizer Overview” explains the process of query optimization, how statistics are applied to search arguments and joins for queries.

Chapter 3, “Advanced Optimizing Tools” describes advanced tools for tuning query performance.

Chapter 4, “Query Tuning Tools” presents an overview of query tuning tools and describes how these tools can interact.

Chapter 5, “Access Methods and Query Costing for Single Tables” describes how Adaptive Server accesses tables in queries that only involve one table and how the costs are estimated for various access methods.

Chapter 6, “Accessing Methods and Costing for Joins and Subqueries” describes how Adaptive Server accesses tables during joins and subqueries, and how the costs are determined.

Chapter 7, “Parallel Query Processing” intoduces the concepts and resources required for parallel query processing.

Chapter 8, “Parallel Query Optimization” provides an indepth look at the optimization of parallel queries.

Chapter 9, “Parallel Sorting” describes the use of parallel sorting for queries and creating indexes.

Chapter 10, “Tuning Asynchronous Prefetch” describes how asynchronous prefetch improves performance for queries that perform large disk I/O.

Chapter 12, “tempdb Performance Issues” stresses the importance of the temporary database, tempdb, and provides suggestions for improving its performance.

Chapter 11, “Multiple Temporary Databases” describes how Adaptive Server allows you to create multiple temporary databases, which you can then use to create temporary objects such as private temporary tables and work tables.

Chapter 13, “Cursors and Performance” describes performance issues with cursors.

Related documents

:

Other sources of information

Use the Sybase Technical Library CD and the Technical Library Product Manuals Web site to learn more about your product:

Sybase certifications on the Web

Technical documentation at the Sybase Web site is updated frequently.

StepsFinding the latest information on product certifications

  1. Point your Web browser to Technical Documents.

  2. Select Products from the navigation bar on the left.

  3. Select a product name from the product list and click Go.

  4. Select the Certification Report filter, specify a time frame, and click Go.

  5. Click a Certification Report title to display the report.

StepsCreating a personalized view of the Sybase Web site (including support pages)

Set up a MySybase profile. MySybase is a free service that allows you to create a personalized view of Sybase Web pages.

  1. Point your Web browser to Technical Documents.

  2. Click MySybase and create a MySybase profile.

Sybase EBFs and software updates

StepsFinding the latest information on EBFs and software updates

  1. Point your Web browser to the Sybase Support Page.

  2. Select EBFs/Updates. Enter user name and password information, if prompted (for existing Web accounts) or create a new account (a free service).

  3. Select a product.

  4. Specify a time frame and click Go.

  5. Click the Info icon to display the EBF/Update report, or click the product description to download the software.

Conventions

This section describes conventions used in this manual.

Formatting SQL statements

SQL is a free-form language. There are no rules about the number of words you can put on a line or where you must break a line. However, for readability, all examples and syntax statements in this manual are formatted so that each clause of a statement begins on a new line. Clauses that have more than one part extend to additional lines, which are indented.

Font and syntax conventions

The font and syntax conventions used in this manual are shown in Table 1.0:

Table 1: Font and syntax conventions in this manual

Element

Example

Command names, command option names, utility names, utility flags, and other keywords are bold.

select sp_configure

Database names, datatypes, file names and path names are in italics.

master database

Variables, or words that stand for values that you fill in, are in italics.

select 

column_name

 
from 

table_name

 
where 

search_conditions

 

Parentheses are to be typed as part of the command.

compute 
row_aggregate
 (
column_name
) 

Curly braces indicate that you must choose at least one of the enclosed options. Do not type the braces.

{cash, check, credit}

Brackets mean choosing one or more of the enclosed options is optional. Do not type the brackets.

[anchovies]
 

The vertical bar means you may select only one of the options shown.

{die_on_your_feet | live_on_your_knees | live_on_your_feet}

The comma means you may choose as many of the options shown as you like, separating your choices with commas to be typed as part of the command.

[extra_cheese, avocados, sour_cream]

An ellipsis (...) means that you can repeat the last unit as many times as you like.

buy thing = price [cash | check | credit] 
 [, thing = price [cash | check | credit] ]...
 

You must buy at least one thing and give its price. You may choose a method of payment: one of the items enclosed in square brackets. You may also choose to buy additional things: as many of them as you like. For each thing you buy, give its name, its price, and (optionally) a method of payment.

sp_dropdevice [ device_name]

or, for a command with more options:

select column_name	from table_name	where search_conditions

In syntax statements, keywords (commands) are in normal font and identifiers are in lowercase: normal font for keywords, italics for user-supplied words.

Case

In this manual, most of the examples are in lowercase. However, you can disregard case when typing Transact-SQL keywords. For example, SELECT, Select, and select are the same. Note that Adaptive Server’s sensitivity to the case of database objects, such as table names, depends on the sort order installed on Adaptive Server. You can change case sensitivity for single-byte character sets by reconfiguring the Adaptive Server sort order.

See in the System Administration Guide for more information.

Expressions

Adaptive Server syntax statements use the following types of expressions:

Table 2: Types of expressions used in syntax statements

Usage

Definition

expression

Can include constants, literals, functions, column identifiers, variables, or parameters

logical expression

An expression that returns TRUE, FALSE, or UNKNOWN

constant expression

An expression that always returns the same value, such as “5+3” or “ABCDE”

float_expr

Any floating-point expression or expression that implicitly converts to a floating value

integer_expr

Any integer expression, or an expression that implicitly converts to an integer value

numeric_expr

Any numeric expression that returns a single value

char_expr

Any expression that returns a single character-type value

binary_expression

An expression that returns a single binary or varbinary value

Examples

Many of the examples in this manual are based on a database called pubtune. The database schema is the same as the pubs2 database, but the tables used in the examples have more rows: titles has 5000, authors has 5000, and titleauthor has 6250. Different indexes are generated to show different features for many examples, and these indexes are described in the text.The pubtune database is not provided with Adaptive Server. Since most of the examples show the results of commands such as set showplan and set statistics io, running the queries in this manual on pubs2 tables will not produce the same I/O results, and in many cases, will not produce the same query plans as those shown here.

If you need help

Each Sybase installation that has purchased a support contract has one or more designated people who are authorized to contact Sybase Technical Support. If you cannot resolve a problem using the manuals or online help, please have the designated person contact Sybase Technical Support or the Sybase subsidiary in your area.