Sybase Ase Techovervw PDF
Sybase Ase Techovervw PDF
PETER THAWLEY
SENIOR DIRECTOR / ARCHITECT, CTO OFFICE
NOVEMBER 2011
<INCLUDE STANDARD.DISCLAIMER>
• Price/performance
Packaged • Availability/Planned Downtime
Apps/SAP • Minimal/Self Management
Business Suite
• Price/performance
• Operational Scalability Custom
Custom • Extreme Performance
• Availability/Planned Downtime Apps/Most
Apps/High • Extreme Scale
• Developer Flexibility Market
End
Verticals
ASE 15.7
R&D
Application
Development
/Productivity
Operational
Security Scalability /
Lower TCO
• Flexible Handling
T-SQL And of LOBs
JDBC/ODBC
API • Reduced Coding
Complexity
LOBS as
• Flexible Handling
Parameters of LOBs
in Stored • Reduced Coding
Procs
Complexity
• Storage Savings
In-Row • Performance
Storage Benefits for
Small LOBs
Locator/LOB Locator
T-SQL Updates
• truncate lob <locator> [(result-length)]
• Truncate to a specific length or deallocate
• return_lob (<datatype>, <locator>)
• Return actual LOB value
• setdata (<locator>, <offset>, <new_value>
• Overwri te some or part of LOB
• substring(<locator>, <start>, <length>)
• Extract a substring from the LOB and return new locator
• Also
• concatenate two LOBs
• Updated functions:
• charindex, char_length, datalength, patindex,
Before
• Couldn’t declare varchar/varbinary/univarchar data exceeding ASE page size
Now
• Declare text/image/unitext LOB for local variable
• Pass local variable as input parameter to stored procedure
• Can prepare SQL statements that include LOB parameters
• Statement cache caches SQL statements with LOBs
• jConnect and ASE ODBC Driver both updated to handle LOBs as input
parameters in stored procedures
12 – Company Confidential – March 20, 2012
ENHANCED LOB MANAGEMENT
IN-ROW & OFF-ROW LOBS
Before
• LOBs always OFF-ROW: ASE always allocates a separate page chain for LOBs regardless
of LOB size.
• Can be very wasteful especially when dealing with small LOBs; mostly empty pages
• Performance penalty
Now
• IN-ROW & OFF-ROW support
• Can maintain LOBs IN-ROW for a pre-defined LOB size with automatic transfer to OFF-
ROW on expansion (due to updates of LOBs exceeding threshold size or other variable
length columns expanding)
• Big benefit to applications making heavy usage of small LOBs
• Relied on heavily in SAP Business Suite’s Deployments on ASE
13 – Company Confidential – March 20, 2012
OPTIMIZED STORAGE
• Storage Savings
• Reduced Memory
Compression
Consumption
• Lower I/O Demands
• Storage Savings
Deferred Table • Ease of Enterprise App.
Materialization deployment & DB
Provisioning
Data Compression
• Compression of regular
relational data in ASE rows
and pages
LOB Compression
• Compression of LOB data
Row
Compression
Row Compression
Data
Compress Away Empty Spaces/zeroes in
Compression Fixed Length Columns. Gives benefit of
varchar without the programming effort
Page
Compression ABC 1 XX “AC”
ABC 1 XX “AC”
Page Compression
• Database • Page Dictionary Compression
Database Attribute for
default
• Repeatedly referenced data replaced by
token recorded in a page dictionary
• Similar to techniques used in Sybase IQ
• Individual
• Page Index Compression (done in ASE 11.9.x)
Table Columns can be
excluded • Duplicate Key Suppression – Columns
with duplicated values stored once and
• Treat active referenced by marker in row
partitions
Partition differently from
• Suffix Compression – Higher levels in
non-active ones. Index only store leading portion of key
required to navigate to next level down
16 – Company Confidential – March 20, 2012
OPTIMIZED STORAGE
LOB COMPRESSION
• Implementation Note:
• SAP Business Suite Deployments – Compression Use Mandatory
400
300
200
100
0
Vanilla Compressed
Total Space 509.56 142.32
No Data
Copy
Scripting
Language • Sybase supported drivers
Drivers
• MERGE/UPSERT
• Sub-SELECT syntax
• Quoted Identifier
T-SQL Updates • Wider DOL rows
• No truncation of trailing 0x0
for binary data during INSERT
Sybase
PERL
Post ASE
Sybase (Perl v5.14+ & 15.7 GA
DBI 1.616+) Sybase
PHP
Ruby
(PHP v5.3.6+)
Post ASE
Sybase 15.7 GA
DBC Sybase
Python API Django
(Python v2.6+)
CT-
Library
25 – Company Confidential – March 20, 2012
APPLICATION DEVELOPMENT
T-SQL UPDATES & CONCURRENCY ENHANCEMENTS
Feature Description Benefit
Merging data from source to • MERGE command allows transfer of rows from a source • Simplify data merge use cases
target table (MERGE/UPSERT) table (table, view, derived table) to a target table • Easy handling of duplicate key
• Inserts rows without matching key columns in target; if errors
matching ones found updates the target table with
values from source row
Sub-SELECT enhancements • Allow asterisk in sub-select with single column • Programming flexibility
• Allow column alias in sub-select
• Allow multiple column names in sub-select under
EXISTS
Quoted Identifier support • Will work on index names, and stored proc invocation • Programming flexibility
of object names (table, view, column, index)
No truncation of trailing 0x0 • Preserve any trailing zeroes for image / binary data • Maintain integrity of binary
during INSERT into VarBinary data stored in a column
columns
SELECT FOR UPDATE locking • Allows selected rows to be locked for a later update • Enhanced concurrency controls
semantics & isolation semantics
• Reduced deadlocks
Start offset on DOL Varlen • DOL variable length columns can begin at a larger offset • Can have “wider” DOL rows in
columns increased for 16K (32767 vs. previous 8192) schema
pages
Release read cursor locks at • Read locks can be released on closing of a cursor at • Programming flexibility
cursor close even for isolation isolation level 2 & 3 for active transaction • Free up resources when not
level > 1 • Configurable at cursor level required
Allow procs / DDL commands • All system procedures and select DDLs can run in • Programming flexibility
in chained transaction mode chained transaction mode
26 – Company Confidential – March 20, 2012
PERFORMANCE
Reduced
Query
Latency
Updated
Kernel
Replication
Performance
Threaded Kernel
(except Windows) 15.7
Each engine is a Each engine is a
separate process thread of a single
Retained in 15.7 for process
risk mitigation Additional threads
for handling I/O, etc.
ASE on Windows has
always been thread
based
Engine 0 Engine 1
… Engine N ASE OS Thread Pools
SPID 1 SPID 7 SPID 3 System Pool
Disks and Databases Clock, Link Monitor,
PSS PSS PSS Disk & Net I/O,
CT-Lib, CIPC
stack
stack
stack
KPROC KPROC KPROC
Blocking
Pool
Shared Executable (Program Memory) Blocking Requests
disk
Hash Hash I/O Pending I/Os
D N
send I E
S T
Other Memory sleep K
Object
Ownership
Change
Login
Profiles
Dual Key
Control
Single Sign-
On
Stronger
P/W &
Hidden Text
Encryption
Default
profiles
– Easier to administer
– Provides flexibility to implement
security policies and comply with
regulations
37 – Company Confidential – March 20, 2012
SECURITY
Feature Description Benefit
Split knowledge • No one person alone can enable decryption of • Compliance with PCI DSS (Payments
& dual control encryption-keys Card Industry Data Security Standards
of keys • Stronger protection of encrypted data from Section 3.5/3.6) requirements
unauthorized access
Stronger • Role passwords are now hashed using one-way • Enhanced password security
password and secure hash (SHA-256); password complexity rules • FIPS 140-2 standards compliance
hidden text enforced
encryption • Strong encryption of external passwords and hidden
text (e.g. in syscomments) (using FIPS-140-2
modules)
Single sign-on & • Automatic passing of user credentials between • Ease of use
E-2-E Kerberos client, mid-tier and server layers • Single sign-on
credential • Single sign-on ASE to ASE connection through CIS
forwarding
Online
REORG
Fully
Recoverable
DDLs
ALTER TABLE
w/o Data
Copy
Shrink
Transaction
Log
Fully recoverable • Use DUMP TRANSACTION to fully recover SELECT • Continuous & point in time recoverability
DDLs INTO, ALTER TABLE commands that require data of a database (even after DDL and
movement, REORG REBUILD minimally logged operations)
• These commands were minimally logged before • No need for DUMP DATABASE after these
• Use sp_dboption to fully log these commands operations are performed
• Operations can readily be embedded
within application logic
• Optimized logging (page vs row logging) to
minimize adverse performance effect
ALTER TABLE • Add a non-null column to a table without data • Performance (huge time savings)
operations copy; allows creation of non-materialized non- • Data availability (potentially reduced
without data null columns; table’s physical data is not changed “outage” by hours depending on
copy • Drop a column table size)
• Modify column type and nullability • Temporary space / disk requirements
reduced / removed (previously full table
Post ASE
copy made)
15.7 GA
• New syntax:
alter database db-name
log off db_device [= size ]
[, db_device [ = size ]]
– Moves the log off the specified DB device
– Without size, removes it off the entire DB device
– With a size, removes that size, starting at the end of that device
• Only possible to move the log off a DB device if that part of the
log is currently empty (i.e. no allocated extents)
– Best practice should be add/remove whole devices at a time so keep the
first N devices sized accurately for normal operation