RE: fragmentation error
Posted in 2006
If a fragmented index performs better, fragment the index:
create index ds_arch_idx on ds_arch (archive_dt) using btree
fragment by expression
partition pt1
(archive_dt < datetime(2003-06-01 00:00:00) year to second) in dbdw00 ,
partition pt2
((archive_dt >= datetime(2003-06-01 00:00:00) year to second ) AND
(archive_dt < datetime(2003-08-10 00:00:00) year to second ) ) in
dbdw00 ,
partition pt3
((archive_dt >= datetime(2003-08-10 00:00:00) year to second ) AND
(archive_dt < datetime(2004-01-01 00:00:00) year to second ) ) in
dbdw00 ,
partition pt4
((archive_dt >= datetime(2004-01-01 00:00:00) year to second ) AND
(archive_dt < datetime(2005-08-10 00:00:00) year to second ) ) in
dbdw00 ,
partition pt5
((archive_dt >= datetime(2005-08-10 00:00:00) year to second ) AND
(archive_dt < datetime(2007-01-01 00:00:00) year to second ) ) in
dbdw01 ,
partition pt6
((archive_dt >= datetime(2007-01-01 00:00:00) year to second ) AND
(archive_dt < datetime(2008-01-01 00:00:00) year to second ) ) in
dbdw01 ,
remainder in dbdw01;
Patrick
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
Yunyao (Fra....
Sent: Tuesday, June 20, 2006 7:59 AM
To: ids@iiug.org
Subject: Re: fragmentation error [6999]
The problem is that if you use,
create index ds_arch_idx on ds_arch (archive_dt) using btree in dbdw00;
The index will NOT be fragmented( i.e., it creates ONR BIG index), that
is not
expected.
The users like the both data and index being fragmented.
Frank
Patrick McD.... wrote:
>Remainders can reside in the same dbspace as the other data partitions.
>It appears that if a remainder clause is included with partitioning the
>table... indexes must include the "in dbspace" clause.
>
>So this should work,
>
>create index ds_arch_idx on ds_arch (archive_dt) using btree in dbdw00;
>
>Patrick
>
>-----Original Message-----
>From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
>Yunyao (Fra....
>Sent: Monday, June 19, 2006 1:39 PM
>To: ids@iiug.org
>Subject: Re: fragmentation error [6986]
>
>HI, Patrick
>
>Looks remiander can not reside at the same dbspace of a partition.
>Otherwise it has following error when creating index....... why ??
>
>create index ds_arch_idx on ds_arch (archive_dt) using btree ;># ^
># 212: Cannot add index.
>#
># 101: ISAM error: file is not open.
>#
>#
>
>Thanks,
>Frank
>
>Patrick McD.... wrote:
>
>
>
>>The remainder clause doesn't require the "partition" keyword...
>>
>>fragment by expression
>>
>>partition part_0001 (cust_cd = '0001' ) in datadbs18 ,
>>
>>remainder in datadbs18
>>
>>Patrick McDonough
>>
>>-----Original Message-----
>>From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
>>ART KAGEL, ....
>>Sent: Monday, June 19, 2006 11:50 AM
>>To: ids@iiug.org
>>Subject: Re: fragmentation error [6984]
>>
>>Sorry, old manual version. I want to say that there's a missing set of
>>parenthesis somewhere but I can't find it in the new syntax manuals.
>>
>>Art S. Kagel
>>----- Original Message -----
>>From: Quman <ids@iiug.org>
>>At: 6/19 14:32:50
>>
>>IDS V10 has partition definition.
>>
>>On 6/19/06, ART KAGEL, .... <kagel@bloomberg.net> wrote:
>>
>>
>>
>>
>>>Loose the 'partition <partitionname> ' clause. That's not Informix
>>>
>>>
>>>
>>>
>>syntax.
>>
>>
>>
>>
>>>Read the manual.
>>>
>>>Art S. Kagel
>>>----- Original Message -----
>>>From: Quman <ids@iiug.org>
>>>At: 6/19 14:18:40
>>>
>>>I have the script and problems.
>>>
>>>case 1 ) If I have a remainder partition, it has synatx error,
>>>
>>>create table "informix".ds_arch
>>>(
>>>
>>>dataset_name varchar(255,44) not null ,
>>>
>>>archive_site char(10) not null ,
>>>
>>>path_name varchar(250,50),
>>>
>>>archive_dt datetime year to second
>>>)
>>>fragment by expression
>>>
>>>partition pt1 (archive_dt < datetime(2003-06-01 00:00:00) year to
>>>second) in dbdw00 ,
>>>
>>>partition pt2 ((archive_dt >= datetime(2003-06-01 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2003-08-10 00:00:00) year to
>>>second ) ) in dbdw00 ,
>>>
>>>partition pt3 ((archive_dt >= datetime(2003-08-10 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2004-01-01 00:00:00) year to
>>>second ) ) in dbdw00 ,
>>>
>>>partition pt4 ((archive_dt >= datetime(2004-01-01 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2005-08-10 00:00:00) year to
>>>second ) ) in dbdw00 ,
>>>
>>>partition pt5 ((archive_dt >= datetime(2005-08-10 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2007-01-01 00:00:00) year to
>>>second ) ) in dbdw01 ,
>>>
>>>partition pt6 ((archive_dt >= datetime(2007-01-01 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2008-01-01 00:00:00) year to
>>>second ) ) in dbdw01 ,
>>>
>>>remainder partition pt_r in dbdw01 extent size 4096 next size 4096
>>>
>>>
>>>
>>>
>>lock
>>
>>
>>
>>
>>>mode row;
>>># ^
>>># 201: A syntax error has occurred.
>>>#
>>>
>>>create index "informix".ds_arch_idx on "informix".ds_arch
(archive_dt)
>>>
>>>
>
>
>
>>>
>>>
>>
>>
>>
>>>using
>>>btree ;
>>>create unique index "informix".ds_arch_uidx on "informix".ds_arch
>>>
>>>(dataset_name,archive_site,archive_dt) using btree ;
>>>alter table "informix".ds_arch add constraint primary key
>>>
>>>
>>>
>>>
>>(dataset_name,
>>
>>
>>
>>
>>>archive_site,archive_dt) constraint "informix".ds_arch_pk
>>>
>>>;
>>>
>>>case 2): If delete remainder partition, the table can be created, but
>>>Index creation error,
>>>
>>>create table "informix".ds_arch
>>>(
>>>
>>>dataset_name varchar(255,44) not null ,
>>>
>>>archive_site char(10) not null ,
>>>
>>>path_name varchar(250,50),
>>>
>>>archive_dt datetime year to second
>>>)
>>>fragment by expression
>>>
>>>partition pt1 (archive_dt < datetime(2003-06-01 00:00:00) year to
>>>second) in dbdw00 ,
>>>
>>>partition pt2 ((archive_dt >= datetime(2003-06-01 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2003-08-10 00:00:00) year to
>>>second ) ) in dbdw00 ,
>>>
>>>partition pt3 ((archive_dt >= datetime(2003-08-10 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2004-01-01 00:00:00) year to
>>>second ) ) in dbdw00 ,
>>>
>>>partition pt4 ((archive_dt >= datetime(2004-01-01 00:00:00) year to
>>>second
>>>
>>>) AND (archive_dt < datetime(2005-08-10 00:00:00) year to
>>>second ) ) in dbdw00 ,
>>>
>>>partition pt5 ((archive_dt >= datetime(2005-08-10 00:0