systabinfo ti_flags and index partition
Posted in 2015
Topics: High Availability & Replication
Greetings.
Solaris 10, IDS 11.5
I am trying to write a utility to examine some internal structures within
sysmaster. Specifically, a query concentrating on systabnames and systabinfo.
I need to treat index partitions differently from a table partition. But how
do I tell the difference? Well, according to information in sysmaster.sql, can
find that in column ti_flags. Specifically:
insert into flags_text values ('sysptnhdr', 262144,'Index Partition');That's 0x40000.
The problem is my query seems to find no entries in systabinfo with this flag
set:
select * from systabinfo ti
where bitval(ti.ti_flags, '0x40000') = 1
I get "No rows found", clearly an insane claim, since there are far more
indexes in our server (or in *any* normal database) than there are tables. Oh,
and I get the same "No rows" if I use the 262144.
At the application level, I can tell an index fragment from a table fragment:
The "indexname" column will have a name. But I had wanted to bypass the table
fragments at the systabnames/systabinfo query to reduce the work at the
application level.
So my questions boil down to:
1. Why isn't this flag set on any partition in my server?
2. If I must accept this non-compliance with the sysmaster.sql setup, how else
might I distinguish a table partition from an index partition within
systabinfo?
Naively yours (for believing the script)
-- Jacob S.
Jacob,
I believe a previous post discussed this issue:
http://www.iiug.org/forums/ids/index.cgi/read/35580
Not pretty but you could rename all your indexes so that tabname in
systabnames tells you if it's an index or not:
example: ix1_customer, ix2_customer, ix3_customer, etc
Steve
> Greetings.
> Solaris 10, IDS 11.5
> I am trying to write a utility to examine some internal structures
> within sysmaster.
>Specifically, a query concentrating on systabnames and systabinfo.
>I need to treat index partitions differently from a table partition.
>But how do I tell the difference? Well, according to information in
>sysmaster.sql,
>can find that in column ti_flags. Specifically:
>insert into flags_text values ('sysptnhdr', 262144,'Index Partition');>That's 0x40000.
>The problem is my query seems to find no entries in systabinfo
>with this flag set:
>select * from systabinfo ti
>where bitval(ti.ti_flags, '0x40000') = 1>I get "No rows found", clearly an insane claim, since there are far more
>indexes in our server (or in *any* normal database) than there are tables.
>Oh, and I get the same "No rows" if I use the 262144.
>At the application level, I can tell an index fragment from a table fragment:
>The "indexname" column will have a name. But I had wanted to bypass the table
>fragments at the systabnames/systabinfo query to reduce the work at the
> application level.
>So my questions boil down to:
>1. Why isn't this flag set on any partition in my server?
>2. If I must accept this non-compliance with the sysmaster.sql setup,
>how else might I distinguish a table partition from an index partition
> within systabinfo?
>Naively yours (for believing the script)
>-- Jacob S.
Here are a few hints:
1. If you look at syst= pnhdr where nkeys > 1 or nkeys=3D1 and
npdata>1, then this partition = has both data and indexes. This was
true from system upgraded from ea= rly version or system catalog
tables.
2. If you look at sysptn= hdr where nkeys=3D0 then this is a data
partition.
3. If= you look at sysptnhdr where nkeys=3D1 and npdata=3D0 then this
is either a= n empty table or an index partition.
John F. Miller III
STSM,= Lead Architect
[1]miller3= @us.ibm.com
503-747-1366
IBM Informix Dynamic Server (IDS)=
[2]-----ids-bounces@iiug.org wrote: -----
=
>To: [3]ids@iiug.or= g
>From: "JACOB SALOMON"
>Sent by: [4]ids-bounces@iiug.org
>Date: = 12/29/2015 08:55AM
>Subject: systabinfo ti=5Fflags and index partitio= n [36298]
>
>Greetings.
>
>Solaris 10, IDS 11.5 <= br>>
>I am trying to write a utility to examine some internal stru= ctures
>within
>sysmaster. Specifically, a query concentrating= on systabnames and
>systabinfo.
>I need to treat index partit= ions differently from a table
partition.
>But how
>do I tell t= he difference? Well, according to information in
>sysmaster.sql, can =
>find that in column ti=5Fflags. Specifically:
>insert into f= lags=5Ftext values ('sysptnhdr', 262144,'Index
>Partition');
>= That's 0x40000.
>
>The problem is my query seems to find no en= tries in systabinfo with
>this flag
>set:
>select * fro= m systabinfo ti
>where bitval(ti.ti=5Fflags, '0x40000') =3D 1
&g= t;
>I get "No rows found", clearly an insane claim, since there are f= ar
>more
>indexes in our server (or in *any* normal database) = than there are
>tables. Oh,
>and I get the same "No rows" if I= use the 262144.
>
>At the application level, I can tell an in= dex fragment from a table
>fragment:
>The "indexname" column w= ill have a name. But I had wanted to bypass
>the table
>fragme= nts at the systabnames/systabinfo query to reduce the work at
>the >application level.
>
>So my questions boil down to:
= >1. Why isn't this flag set on any partition in my server?
>2. If= I must accept this non-compliance with the sysmaster.sql
setup,
>how= else
>might I distinguish a table partition from an index partition= within
>systabinfo?
>
>Naively yours (for believing th= e script)
>
>-- Jacob S.
>
>
>*************=
********************************************************
>********** =
> Forum Note: Use "Reply" to post a response in the discussion foru=
m.
>
>
>
References
1. 3D"mailto:miller3@us.ibm.com"
2. 3D"mailto:-----=
3. 3D"mailto:ids@iiug.org"
4. 3D"mailto:ids-bounces@iiug.org"