Oracle introduced a compression option for indexes in Oracle 8.1. You can create an index as compressed, or rebuild it to compress it (although there are some restrictions about online rebuilds, rebuilds of partitioned indexes etc.) Typical syntax might be:
create index t1_ci_1 on t1(col1, col2, col3, col4) compress 2;
alter index t1_ci_1 rebuild compress 2;
The benefits of compression come from the fact that a properly compressed index uses a smaller number of leaf blocks - which tends to mean that less I/O is involved when the index is used, there is a reduced amount of buffer cache flushing, and the optimizer is likely to calculate a lower cost for using that index for range scans. (There is a tiny chance that the number of branch blocks, and the index height might be reduced, too, but that is a little unlikely).
But compressing indexes, especially compressing the wrong number of columns, can have negative impact on your performance. If you compress more columns than you should, the 'compressed' index may be larger than the uncompressed index. Use the validate option on the index, and check view index_stats to find out the optimum compression count. How did I know that I should compress just the first two columns of the t1_ci_1 index ? (Apart from knowing the data, that is):
validate index t1_ci_1;
select
opt_cmpt_count, opt_cmpr_pctsave
from
index_stats;
opt_cmpt_count opt_cmpr_pctsave
-------------------------------
2 50
Unfortunately these two columns don't exist in 8.1, only in version 9 (possibly only 9.2). Fortunately Steve Adams has a script on his website to recommend a compression level (see www.ixora.com.au )
Even if you get the 'right' number of columns compressed, there is a price to pay: The main penalties are: (a) reads and mods of a compressed index cost more CPU than they would (typically) for an equivalent uncompressed index (b) execution paths change - and you may not have predicted the changes, and some nominally cheaper paths may actually be slower. for example: Oracle may choose an index fast full scan instead of an index range scan because the compressed index is now much smaller, and your setting for parameter db_file_multiblock_read_count is large; or Oracle may choose to use an index and do a nested loop because the index is now 30% smaller, where previously it was doing a table scan and hash join.
So - don't go and compress all the indexes in your schema.
Think carefully about which indexes could give you significant gains, and whether you can afford some CPU loss to reduce buffer thrashing and I/O.
Remember too, if the way you use an index is such that the column order doesn't matter, then perhaps you could rearrange the column order to maximise the compression. The most critical point, perhaps, is that you should avoid moving a column that is typically used with a range scan towards the front of the index.t
分享到:
相关推荐
在IT领域,尤其是在地理信息系统(GIS)中,`Compressing`和`Compacting`是两个重要的概念,它们分别用于优化File Geodatabase的存储效率和访问速度。下面将详细阐述这两个操作的区别和应用场景。 首先,`...
authors Witten, Moffat, and Bell continue to provide unparalleled coverage of state-of-the-art techniques for compressing and indexing data. Whatever your field, if you work with large quantities of ...
Gilbert(AT&T实验室)和Kirill Levchenko(加州大学圣地亚哥分校),两位作者在论文《Compressing Network Graphs》中提出了一种针对大规模网络图的压缩方法。 在计算机网络和数据可视化领域,图是表达现实世界...
Managing gigabytes:compressing and indexing documents and images英文扫描版,共2部分。作者是Ian H. Witten/Alistair Moffat/Timothy C. Bell,应该是全面介绍信息检索最好的书了。
目前支持: 柏油gzip g 压缩安装npm install compressing用法压缩单个文件以gzip为例,tar,tgz和zip与gzip相同。 诺言风格 const compressing = require ( 'compressing' ) ;// compress a filecompressing . gzip...
VideoCompression Compressing 25Mb videofile to 1MbVideoCompression Compressing 25Mb videofile to 1MbVideoCompression Compressing 25Mb videofile to 1MbVideoCompression Compressing 25Mb videofile to 1...
### 相关知识点 #### 一、引言与背景 **RFC 1144** 是一份关于在低速串行链路上压缩TCP/IP报头的提议性协议文档。该文档由V....其目标是为了改善在低速串行链路上传输TCP/IP数据包时的性能问题。...
A Difference Resolution Approach to Compressing Access Control Lists。
Managing gigabytes 英文版,图片格式的。 看到有位兄弟上传了djvu格式的,可能有些LINUX下的看不了。上传这个版本。另外,我买了那个名为“深入搜索引擎”的中文版,不得不说翻译书不是个容易的活儿,英文不过关...
《压缩感知——沙威编写 压缩感知基础编程 重构的基础编程》 在信息技术领域,压缩感知(Compressed Sensing,简称CS)是一种革命性的信号处理技术,它改变了传统采样理论,允许以远低于奈奎斯特定理所规定的速率...
其次,**压缩(Compressing)**是指减小文件大小,通常通过删除不必要的字符,如空格、换行符和注释,同时保留代码的可执行性。这有助于减少数据传输量,加快下载速度。ASP.NET框架支持GZIP和DEFLATE等压缩算法,...
- Create .jar and .cab-files containing client-specific .class-files and the images-folder (use zip and cabarc compressing tools) - Adapt the customchat.html file - Upload all the files to your web...
method of compressing digital images--数字图像压缩方法的,2010年较新欧洲发明专利
为了克服这一难题,"Compressing Geodesic Information for Fast Point-to-Point Geodesic Distance" 提出了一种创新的存储策略,能够快速地检索和计算点对点的测地线距离。 文章作者克雷格·格茨曼和凯·霍尔曼...
Spectral interval compressing structure in spectral beam combination system for diode laser arrays
总的来说,"Deep Compression-Compressing-Deep-Neural-Networks-with-Pruning-Trained-Quantization-and-Huffman"提供了一个实用的工具,帮助研究者和开发者应对深度学习模型的大小问题,为在资源受限的环境中运行...
## MISC-压缩包 - 简介: 压缩包分析在CTF-MISC中也是常见的题型,压缩包是一个电脑应用软件,可以减小文件中的比特和字节总数,达到节省磁盘空间等作用。其基本原理是查找文件内的重复字节,并建立一个相同字节...
Managing gigabytes 英文版,图片格式的。 看到有位兄弟上传了djvu格式的,可能有些LINUX下的看不了。上传这个版本。另外,我买了那个名为“深入搜索引擎”的中文版,不得不说翻译书不是个容易的活儿,英文不过关...