Partitioning, Index Bitmaps et Compression

C’est assez étrange pour faire l’objet d’un post, même si pour l’instant, j’ai du mal à imaginer le pourquoi ou encore les implications. Enfin voila : testé ce matin en 11.1.0.6, si vous avez une table partitionnée avec un index bitmap, la première fois que vous voulez compresser une partition, vous rencontrerez l’erreur qui suit:

ORA-14646: Specified alter table operation involving compression cannot be performed in the presence of usable bitmap indexes
Cause:
The first time a table is altered to include compression, it cannot have a usable bitmap index (partition). Subsequent alter table statements involving compression do not have this same restriction.
Action:
A) Drop any bitmap indexes defined on the table, and re-create them once the operation is complete or,
B) Mark all index fragments of all bitmap indexes defined on the table UNUSABLE and rebuild them once the operation is complete.

Mais ensuite plus d’erreur (comme dit la doc !). Au début, je me suis simplement dit : « Ils ont oublié le cas des tables partitionnées ? » J’avais tord ! Voici ci-dessous la transcription du test :

create table x (x number,
y number,
attr1 number
)
partition by range (x)
subpartition by hash(y) subpartitions 16
(partition x1 values less than(10000));

alter table x
add partition x2 values less than(20000);

create unique index x_idx
on x(x,y) local;

alter table x
add constraint x_pk
primary key (x,y)
using index x_idx;

create bitmap index x_bidx
on x(attr1) local;

select subpartition_name
from dba_tab_subpartitions
where table_name='X'
and partition_name='X1' and subpartition_position=1;

SUBPARTITION_NAME
-----------------
SYS_SUBP7081

alter table x
move subpartition SYS_SUBP7081 compress;

*
ERROR at line 1:
ORA-14646: Specified alter table operation involving compression cannot be
performed in the presence of usable bitmap indexes

drop index x_bidx;

alter table x
move subpartition SYS_SUBP7081 compress;

create bitmap index x_bidx
on x(attr1) local;

select subpartition_name
from dba_tab_subpartitions
where table_name='X'
and partition_name='X1'
and subpartition_position=2;

SUBPARTITION_NAME
-----------------
SYS_SUBP7082

alter table x
move subpartition SYS_SUBP7082 compress;

Table altered.

select INDEX_NAME,
SUBPARTITION_NAME,
STATUS,
COMPRESSION
from dba_ind_subpartitions
where index_name='X_BIDX'
and subpartition_name='SYS_SUBP7082';

INDEX_NAME SUBPARTITION_NAME STATUS COMPRESS
---------- ----------------- ------- --------
X_BIDX SYS_SUBP7082 USABLE DISABLED

Et ce comportement est identique avec DBMS_REDEFINITION. Vu que l’index est local et que je ne compresse qu’une sous-partition, je ne comprends pas les motivations de cette erreur. A la lumière de cette erreur, peut-être faut-il compresser une sous-partition (vide) avec une table partitionnée avec des index bitmaps ? D’un autre coté quel est le véritable impact d’une telle idée ?

Quelqu’un se sent-il de taille de faire une suggestion intelligente ?

1 réflexion sur “Partitioning, Index Bitmaps et Compression”

Les commentaires sont fermés.