我们有 oracle 12c 数据库。我们将很快迁移到 19c。通常我们遵循规则来压缩表(高级 OLTP 压缩)并保持索引未压缩。现在我们面临的情况是,根据列数,我们有一些 800GB 的索引,其对应的表是 200GB(压缩)
有人可以帮助我理解以下内容 -
- 表压缩是否对查询性能/表加载有影响
- 我们应该压缩索引吗?它会影响加载或查询的性能吗?
- 如果表是分区的,我们可以选择性地按分区压缩本地 indexex 分区。
Oracle 压缩是否有任何最佳实践或注意事项?
我们有 oracle 12c 数据库。我们将很快迁移到 19c。通常我们遵循规则来压缩表(高级 OLTP 压缩)并保持索引未压缩。现在我们面临的情况是,根据列数,我们有一些 800GB 的索引,其对应的表是 200GB(压缩)
有人可以帮助我理解以下内容 -
Oracle 压缩是否有任何最佳实践或注意事项?
Re 1:
Table compression can have an impact on performance, mostly a positive one. However, it is nearly impossible to predict, as it depends on the data, and on the order the data is inserted into the table, the number of updates, etc.
I'd normally check firstly the potential compression ratio of a table, either with dbms_compression.get_compression_ratio
or by simply creating a compressed and an uncompressed copy of the table (or a subset of the rows if too big).
Re 2: Index compression eliminates leading values in multicolumn indexes, so the answer is the same as for 1.
Re 3: Yes. According to the partitioning guide, you can use
CREATE INDEX i_cost1 ON costs_demo (prod_id) COMPRESS LOCAL (
PARTITION costs_old, PARTITION costs_q1_2003,
PARTITION costs_q2_2003, PARTITION costs_recent NOCOMPRESS);