View Single Post

   
  #8 (permalink)  
Old 04-20-2008, 11:31 AM
Quman
 
Posts: n/a
Default Re: fragment elimination on query

HI, Superboer!

You raised a excellent question.

The table is not new and the primary key can not be redefined(referenced by
other tables already).

datatype_name is the only possible column to be used as fragmenting
key(column), so a global unique index on "inventory_id" can not be
fragmented by informix.
So, my question is,
Is it possible or reasonable to have a fragmented unique index( index keys
do not include fragmentation keys) in future Informix?

Thanks,
Quman

On 6 Jul 2006 23:26:15 -0700, Superboer <superboer7@t-online.de> wrote:
>
> Hello Quman
>
> it is using the index to fetch the data;
>
> > select * from ds_head
> > where datatype_name like "AV%"
> >
> >
> > Estimated Cost: 2797
> > Estimated # of Rows Returned: 7947
> >
> > 1) informix.ds_head: INDEX PATH

>
> try giving it an hint not to use the index or drop the index; then
> you'll probably see frag elimantion.
>
> OR better fragment your index too...
> this one:
>
> > create index "informix".ds_head_idx2 on "informix".ds_head

> (datatype_name,
> > inventory_id) using btree ;

>
>
> Superboer.
>
>
>
> Quman schreef:
>
> > I have a table,
> >
> > create table "informix".ds_head
> > (
> > inventory_id serial not null ,
> > dataset_name varchar(255,44) not null ,
> > dataset_size_bytes integer,
> > datatype_name char(10) not null ,
> > datatype_version char(10),
> > ingest_status char(10),
> > ingest_dt datetime year to second not null ,
> > orig_data_filenm varchar(255,44) not null ,
> > distribution_site char(1) not null ,
> > data_source char(10),
> > has_visual_file char(1),
> > restriction_level smallint
> > ) with crcols
> > fragment by expression
> > partition pt1 (datatype_name LIKE 'GVAR%' ) in dbdata00 ,
> > partition pt2 (datatype_name LIKE 'GOES%' ) in dbdata01 ,
> > partition pt3 (datatype_name LIKE 'CW%' ) in dbdata02 ,
> > partition rmd remainder in dbdw00
> > extent size 8192 next size 8192 lock mode row;
> >
> > reate unique index "informix".ds_head_idx0 on "informix".ds_head
> > (dataset_name,datatype_name) using btree ;
> > create index "informix".ds_head_idx2 on "informix".ds_head

> (datatype_name,
> > inventory_id) using btree ;
> >
> > create unique index "informix".ds_head_ipk on "informix".ds_head
> > (inventory_id) using btree in dbdw01 ;
> >
> > alter table "informix".ds_head add constraint primary key (inventory_id)
> > constraint "informix".ds_head_pk ;
> >
> >
> > I made a query with a EXPLAIN ON,
> >
> >
> > select * from ds_head
> > where datatype_name like "AV%"
> >
> >
> > Estimated Cost: 2797
> > Estimated # of Rows Returned: 7947
> >
> > 1) informix.ds_head: INDEX PATH
> >
> > (1) Index Keys: datatype_name (Serial, fragments: ALL)
> > Lower Index Filter: informix.ds_head.datatype_name LIKE 'AV%'
> >
> > Looks IDS does search all fragments, not just ONE partition rmd.
> >
> > Is this because "LIKE" is too confuse to be used by optimizer? If so,

> what
> > operator we should use?
> >
> > Thanks,
> >
> > Quman
> >
> > ------=_Part_72260_7493042.1152212713507
> > Content-Type: text/html; charset=ISO-8859-1
> > X-Google-AttachSize: 2706
> >
> > <div>&nbsp;</div>
> > <div>I have a table,</div>
> > <div>&nbsp;</div>
> > <div>create table &quot;informix&quot;.ds_head<br>&nbsp;

> (<br>&nbsp;&nbsp;&nbsp; inventory_id serial not null ,<br>&nbsp;&nbsp;&nbsp;
> dataset_name varchar(255,44) not null ,<br>&nbsp;&nbsp;&nbsp;
> dataset_size_bytes integer,<br>&nbsp;&nbsp;&nbsp; datatype_name char(10) not
> null ,<br>&nbsp;&nbsp;&nbsp; datatype_version char(10),
> > <br>&nbsp;&nbsp;&nbsp; ingest_status char(10),<br>&nbsp;&nbsp;&nbsp;

> ingest_dt datetime year to second not null ,<br>&nbsp;&nbsp;&nbsp;
> orig_data_filenm varchar(255,44) not null ,<br>&nbsp;&nbsp;&nbsp;
> distribution_site char(1) not null ,<br>&nbsp;&nbsp;&nbsp; data_source
> char(10),<br>&nbsp;&nbsp;&nbsp; has_visual_file char(1),
> > <br>&nbsp;&nbsp;&nbsp; restriction_level smallint<br>&nbsp; ) with

> crcols<br>&nbsp; fragment by expression<br>&nbsp;&nbsp;&nbsp; partition pt1
> (datatype_name LIKE 'GVAR%' ) in dbdata00 ,<br>&nbsp;&nbsp;&nbsp; partition
> pt2 (datatype_name LIKE 'GOES%' ) in dbdata01 ,<br>&nbsp;&nbsp;&nbsp;
> partition pt3 (datatype_name LIKE 'CW%' ) in dbdata02 ,
> > <br>&nbsp;&nbsp;&nbsp; partition rmd remainder in dbdw00<br>&nbsp;

> extent size 8192 next size 8192 lock mode row;<br>&nbsp;</div>
> > <div>reate unique index &quot;informix&quot;.ds_head_idx0 on

> &quot;informix&quot;.ds_head<br>&nbsp;&nbsp;&nb sp;
> (dataset_name,datatype_name) using btree ;<br>create index
> &quot;informix&quot;.ds_head_idx2 on &quot;informix&quot;.ds_head
> (datatype_name,
> > <br>&nbsp;&nbsp;&nbsp; inventory_id) using btree ;</div>
> > <div>&nbsp;</div>
> > <div>create unique index &quot;informix&quot;.ds_head_ipk on

> &quot;informix&quot;.ds_head<br>&nbsp;&nbsp;&nb sp; (inventory_id) using
> btree&nbsp; in dbdw01 ;<br>&nbsp;</div>
> > <div>alter table &quot;informix&quot;.ds_head add constraint primary key

> (inventory_id)<br>&nbsp;&nbsp;&nbsp; constraint
> &quot;informix&quot;.ds_head_pk&nbsp; ;<br>&nbsp;</div>
> > <div>&nbsp;</div>
> > <div>I made a query with a&nbsp; EXPLAIN&nbsp; ON,</div>
> > <div>&nbsp;</div>
> > <div>
> > <p>select * from ds_head<br>where datatype_name like &quot;AV%&quot;</p>
> > <p><br>Estimated Cost: 2797<br>Estimated # of Rows Returned: 7947</p>
> > <p>&nbsp; 1) informix.ds_head: INDEX PATH</p>
> > <p>&nbsp;&nbsp;&nbsp; (1) Index Keys: datatype_name&nbsp;&nbsp; (Serial,

> fragments: ALL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lower Index
> Filter: informix.ds_head.datatype_name LIKE 'AV%'<br></p>
> > <p>Looks IDS does&nbsp; search all fragments, not just&nbsp; ONE

> partition rmd.</p>
> > <p>Is this because &quot;LIKE&quot;&nbsp;&nbsp;is &nbsp;too confuse to

> be used by optimizer? If so, what operator we should use?</p>
> > <p>Thanks,</p>
> > <p>Quman</p>
> > <p>&nbsp;</p>
> > <p>&nbsp;</p></div>
> > <div>&nbsp;</div>
> > <div><br>&nbsp;</div>
> > <div>&nbsp;</div>
> >
> > ------=_Part_72260_7493042.1152212713507--

>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>


Reply With Quote