Rev. 11.2012 SYBASE ASE: COMPRESSION OPTION mailto:

Slides:



Advertisements
Similar presentations
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Advertisements

Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Chapter 18 Methodology – Monitoring and Tuning the Operational System Transparencies © Pearson Education Limited 1995, 2005.
Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.
MySQL Access Privilege System
Data Management and Index Options for SQL Server Data Warehouses Atlanta MDF.
Rev SYBASE ASE: MDA TABLE ASSISTANT Sybase Administration Tools available at: mailto:
<Insert Picture Here>
Sybase ASE: column encryption
© IBM Corporation Informix Chat with the Labs John F. Miller III Unlocking the Mysteries Behind Update Statistics STSM.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
Segmentation and Paging Considerations
Rev SYBASE ASE: GRAPHICAL MONITOR Sybase Administration Tools available at: mailto:
Rev SYBASE ASE: LOAD GENERATOR Sybase Administration Tools available at: mailto:
Rev SYBASE ASE: DB FRAGMENTATION Sybase Administration Tools available at: mailto:
Project Management Database and SQL Server Katmai New Features Qingsong Yao
Module 6 Implementing Table Structures in SQL Server ®2008 R2.
Memory Management Design & Implementation Segmentation Chapter 4.
Physical Database Monitoring and Tuning the Operational System.
Hash Tables1 Part E Hash Tables  
Harvard University Oracle Database Administration Session 5 Data Storage.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
CHAPTER 11 Large Objects. Need for Large Objects Data type to store objects that contain large amount of text, log, image, video, or audio data. Most.
Implementing Database Snapshot & Database Mirroring in SQL Server 2005 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
ASP.NET Programming with C# and SQL Server First Edition
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
1 Oracle Database 11g – Flashback Data Archive. 2 Data History and Retention Data retention and change control requirements are growing Regulatory oversight.
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.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
Oracle Advanced Compression – Reduce Storage, Reduce Costs, Increase Performance Session: S Gregg Christman -- Senior Product Manager Vineet Marwah.
Module 5 Planning for SQL Server® 2008 R2 Indexing.
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Cleansing Ola Ekdahl IT Mentors 9/12/08.
10/10/2012ISC239 Isabelle Bichindaritz1 Physical Database Design.
Physical Database Design Transparencies. ©Pearson Education 2009 Chapter 11 - Objectives Purpose of physical database design. How to map the logical database.
ITCS373: Internet Technology Lecture 5: More HTML.
DB2 10 Hash Access: Access Path or Collision Course? Donna Di Carlo BMC Software Session Code: A13 Wednesday, 16 November 2011 | Platform: DB2 for z/OS.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
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.
Methodology – Physical Database Design for Relational Databases.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
SQL SERVER DAYS 2011 Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Chapter 5 Index and Clustering
Session 1 Module 1: Introduction to Data Integrity
Student Centered ODS ETL Processing. Insert Search for rows not previously in the database within a snapshot type for a specific subject and year Search.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Creating Indexes on Tables An index provides quick access to data in a table, based on the values in specified columns. A table can have more than one.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
1 Chapter 9 Tuning Table Access. 2 Overview Improve performance of access to single table Explain access methods – Full Table Scan – Index – Partition-level.
for all Hyperion video tutorial/Training/Certification/Material Essbase Optimization Techniques by Amit.
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
SQL Basics Review Reviewing what we’ve learned so far…….
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Virtual Memory.
ASE Optdiag Features including dynamic_histogram
Module 11: File Structure
Physical Changes That Don’t Change the Logical Design
Database Performance Tuning and Query Optimization
Main Memory Management
DATABASE MANAGEMENT SYSTEM
STRUCTURED QUERY LANGUAGE
Chapter 11 Database Performance Tuning and Query Optimization
Large Object Datatypes
Responding to Data Manipulation Via Triggers
Presentation transcript:

Rev SYBASE ASE: COMPRESSION OPTION mailto:

Information posted in this and other presentations found here by no mean represent Sybase official position. It is an independent opinion based on functionality tests performed in controlled testing environment. Although the author made its best to represent data in an accurate and unbiased manner, there is always a possibility of an error. The opinions expressed by this and other presentations must be taken with a degree of skepticism. Since SAP Sybase allows to test before purchasing most of its products and product options, it is strongly recommended to run performance and/or functionality tests on local systems. No two systems are identical. Things good for Zeus may be harmful for a bull. NOTE AND DISCLAIMER:

Compression option was introduced into Sybase ASE in the 15.7 version, disclosed at 2010 Tech-wave. In Sybase ASE compression is available on several levels: On a row level, by means of which empty data on a data row is eliminated. On a page level, by means of which in addition to eliminating empty row data, duplicate data on each page is replaced by a token and a link. For LOB objects, as ASE implementation of FastLZ (LZO) and ZLib (LZW.26) compression algorithms (out of scope of this paper). Compression is a licensed option and must be enabled the same way encryption, partitioning, &c options are enabled. ASE COMPRESSION: QUICK INFO

Row-level compression is intended for fixed-length, regular data. For most fixed-length columns, data does not completely occupy the space reserved for the row. 32-bit integer with a value of 2 is represented by 0x10 in hexadecimal. Adaptive Server requires 1 byte to represent this value, but fills the other 3 bytes of the row with zeros. Similarly, if a 50-byte fixed-length character column includes the character data a, Adaptive Server requires 1 byte for the character data, but completes the column with zeros. Some fixed-length data-types are not compressed because there is no benefit in doing so. For a complete list of data-types and their possible compression levels, advise the Compression Users Guide available at /doc/pdf/ase_compression_users.pdf /doc/pdf/ase_compression_users.pdf COMPRESSION: ROW LEVEL

Page-level compression addresses data redundancy on a page. When you specify page-level compression for regular data, Adaptive Server performs row-level compression first, then page-level compression. Adaptive Server includes a number of techniques for page-level compression: Extracting repetitive information from variable-length byte strings and replacing them with shorter symbols. When you insert a new row into a data page, Adaptive Server first compares the data in the columns with the symbols in the page dictionary. Extracting and removing short, duplicate values that use fixed-length columns from the rows. Adaptive Server stores the duplicate value in the page index, and uses a status bit in the row to indicate that this value is stored in the page index and is available for compression. Compression does not automatically occur on a table configured for page-level compression until you insert a row that causes the page to become full. COMPRESSION: PAGE LEVEL

Compression may be turned on on different levels On database level: CREATE DATABASE DB … WITH COMPRESSION = PAGE | ROW | NONE ALTER DATABASE DB … SET COMPRESSION = PAGE | ROW | NONE On table level: CREATE TABLE … WITH COMPRESSION = SELECT INTO … WITH COMPRESSION = ALTER TABLE SET COMPRESSION = followed by REORG REBUILD On partition level * : partition by... ([part_name]... [with compression = {page|row }]...) On column level: CREATE TABLE TBL (colA int not null NOT COMPRESSED, colB int null) WITH COMPRESSION = ROW On session level: SET COMPRESSION ON|DEFAULT * This allows you to compress data only for specific partitions. Partition may be compressed / decompressed as needed using alter table.. modify partition … set compression = {type} clause. COMPRESSION: ENABLING

Compression may be turned off on different levels. On database level: ALTER DATABASE DB … SET COMPRESSION = NONE On table level: ALTER TABLE SET COMPRESSION = NONE (followed by REORG REBUILD) On partition level: ALTER TABLE … MODIFY PARTITION … SET COMPRESSION = NONE... On column level: ALTER TABLE TBL MODIFY ColA int NOT COMPRESSED On session level: SET COMPRESSION OFF Turning on/off compression does not affect the rows already stored in a table. The table/partition must be rebuilt to enforce the actual data compression type. A table may have compressed and uncompressed data co-existing side by side. COMPRESSION: DISABLING

Compressed data is first decompressed, then returned to client BCP OUT – any compressed rows (including those with text data) are decompressed and returned to the client, either in native or character form. BCP IN – uncompressed data received from the client is compressed during the insert. BCP IN selects the appropriate compression scheme, which depends on the compression level of the partition into which you are inserting the row. DUMP DATABASE dumps compressed data directly from disk to archive COMPRESSION: RETRIEVING

Compression is restricted for in-memory databases. Loading and recovering compressed objects in disk-resident or relaxed- durability in-memory databases is permitted. However, Adaptive Server often restricts access to compressed objects in the target in-memory database. What this cryptic statement means is that you may load a compressed DB dump into IMDB, but at your own risk. I have been able to access compressed table data in IMDB. But the statement raises concern about IMDB functionality with compression turned on for the source DB. Adaptive Server provides minimal support for disabling compression in the target database or in tables defined for compression, so you may revert to using uncompressed data. Not very obvious what minimal support actually means. Anyway, you will get an error message when attempting to turn compression on in IMDB. Compressed LOB columns do not support replication. COMPRESSION: RESTRICTIONS

According to the Compression Users Guide compression is said to be beneficial in three ways: Use less storage space for the same amount of data Reduce cache memory consumption Improve performance because of lower I/O demands I have performed practical tests to check each of the suppositions. What you will find in the remainder of this paper is some data that addresses each of these claims. COMPRESSION: TO BE OR NOT TO BE?

It is obvious that the compression ratio is strongly influenced by the type of data a table contains (both in terms of data-types & in terms of actual data values). Below is a compression ratio for a sample table that contains only fixed size data-types: monSysStatement (mostly integer values). COMPRESSION: STORAGE USAGE

From the standpoint of storage economy, compression may easily result in reducing the size of your data by more than a half. Page-level compression allows the greatest degree of compression, since it includes row-level compression. For this sample table page-level compression added an additional 10% economy over the row-level compression. * The numbers here are very much table/data specific and should not be taken as absolute values. COMPRESSION: STORAGE USAGE

Below is the impact compression has had on a data cache for our sample table. COMPRESSION: CACHE USAGE Pretty straightforward too: since objects have shrunk in size, their cache footprints are reduced by a comparable ratio.

This claim is much more complicated… It is quite obvious that reduced IO activity may give ASE an extra breathing space: Less IO = Less Waits = Less Context Switches = Less Exhausted Time Slices = Less Cache Turnover &c… And yet, we must not forget that compression, for all its reduced IO benefits, has its price: we must decompress and lookup compressed values in page dictionary/page index for each compressed data row. So what is more efficient: cutting the stored data size by half or avoiding ASE engine overhead of decompressing & locating compressed values? COMPRESSION: IMPROVE PERFORMANCE

I have summarized below Statistics IO/Time details when working with different compression levels for inserts, updates, selects and index creation on the same sample table. COMPRESSION: PERFORMANCE

What we may see from this general picture is that raw CPU Time ASE spends on servicing the same types of requests may grow by 20% to 430% factor. For an overloaded ASE this may be bad news. BUT - DML/DDL/SELECT operations fare quite differently: For SELECT operations, compression is definitely a beneficial feature (less CPU/Elapsed time, far less Logical/Physical IO). For DMLs, compression is beneficial for response time (lower Elapsed Time), but CPU Time may grow by 10% to 50%, depending on compression type. For DDL (create index), compression causes ASE to do 200%-450% more CPU work (CPU Time), but curiously enough, response time is still better (10%- 40% drop in Elapsed Time). As said earlier, cache / storage usage benefits from compression. COMPRESSION: PERFORMANCE

We have seen that ASE compression is quite an impressive feature: It may be configured with a great ease (even on separate partition level). It is great for storage/data cache economy (60%+ space economy). It reduces response time as a rule. Still, CPU time for DML/DDL requests may grow by 50% to 450% factor. Page level compression is definitely a feature not to be used thoughtlessly on a busy OLTP system. Row level compression seems to have a moderate impact, although it use too must be tested first. All in all, this is an option worth diving into – especially but by no means only for DSS systems with partitioning. COMPRESSION: CONCLUSION

Row-level compression footprint on: 1.Create index (clustered/non-clustered). 2.Select (count(*),*,via Index, Table Scan, Ranges). 3.Inserts, Updates (via Index, Table Scan). 4.For small sized/large sized table. COMPRESSION: ADDENDUM

Page-level compression footprint on: 1.Create index (clustered/non-clustered). 2.Select (count(*),*,via Index, Table Scan, Ranges). 3.Inserts, Updates (via Index, Table Scan). 4.For small sized/large sized table. COMPRESSION: ADDENDUM

Row-level compression (index keys spared) footprint on: 1.Create index (clustered/non-clustered). 2.Select (count(*),*,via Index, Table Scan, Ranges). 3.Inserts, Updates (via Index, Table Scan). 4.For small sized/large sized table. COMPRESSION: ADDENDUM

Feedback and corrections may be either sent directly to or posted as comments in the blog space. The blog is available at More presentations/tools are available for download throughout the blog space. You are welcome to post your own ideas there which may be later transformed into customized tools/feature tests and posted for the benefit of general public. FEEDBACKS