Where records the fragment table's partnum ?!
Posted in 2008
A user dissecting on-disk structures couldn't find the partnums of a fragmented table in the systables partition page, as he could for a non-fragmented table. Answers: each fragment (and index fragment) has its own partition page in its own dbspace, and the partnum's high bits are the dbspace number with the rest the logical page number, so it can be dumped with oncheck -pp <dbspace tblspace> <page>. For fragmented tables systables.partnum is 0 and the per-fragment detail lives in sysfragments; all fragments share a lockid equal to the first fragment's partnum, visible via oncheck -pt or sysmaster (systabnames, sysptnhdr). The poster confirmed this answered his question.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Storage & Space Management
Dear All...
I have a non fragment table said table quote in nologtest DB ,
I do : oncheck -pt nologtest:systables and get the extents 2a684e ,
and then I oncheck -pP 2 0xa6852 , I see slot 15 is about quote ,
also I will see the partnum of nologtest:quote will showes in slot 15's
27 ~ 30 bytes .... so far so good !!!
and then , I create a fragment table like following :
create table "informix".stkhis
(
stkday date,
stkid char(6),
stkclose decimal(10,3),
stkpref decimal(10,3),
stklow decimal(10,3),
stkhigh decimal(10,3),
stkvol decimal(14,3),
stkvalue decimal(18,3)
)
fragment by expression
(stkid [1,1] <= '5' ) in dbspace1 ,
(stkid [1,1] >= '6' ) in dbspace2
extent size 160 next size 160 lock mode row;
create unique index "informix".stkhis_ix on "informix".stkhis
(stkid,stkday desc) in dbspace3 ;
and then , oncheck -pt nologtest:stkhis showes 3 part of partition :
Table fragment in DBspace dbspace1
Partition partnum 2097908(0x2002F4)
Table fragment in DBspace dbspace2
Partition partnum 3145730(0x300002)
Index stkhis_ix fragment in DBspace dbspace3
Partition partnum 4194306(0x400002)
and in oncheck -pP 2 0xa6853 slot 6 , I can not find any of these partnum
information :
slot 6:
0: 73 74 6b 68 69 73 20 20 20 20 20 20 20 20 20 20 stkhis
16: 20 20 69 6e 66 6f 72 6d 69 78 0 0 0 0 0 0 informix......
32: 0 79 0 3a 0 8 0 1 0 0 0 0 0 0 9b 7 .y.:............
48: 0 79 0 2 54 52 0 0 0 0 0 0 0 a0 0 0 .y..TR....... ..
64: 0 a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . ..............
80: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ................
96: 0 0 0 0 0 0 0 0 ................
My question is : in a fragment table , where record the partnum page address ?!
Thanks ~~
When you create a fragmented table you will have a partition page (or
tablespace tablespace page) for each fragment, in the dbspace where that
fragment resides. In your case:
Table fragment in DBspace dbspace1
Partition partnum 2097908(0x2002F4)
Table fragment in DBspace dbspace2
Partition partnum 3145730(0x300002)
Index stkhis_ix fragment in DBspace dbspace3
Partition partnum 4194306(0x400002)
In dbspace #2 you have a partition page whose logical address is 0x2002f4
In dbspace #3 you have a partition page whose logical address is 0x300002
In dbspace #4 you have a partition page whose logical address is 0x400002
The logical address is made up of dbspace # and logical page #. So in the
first example the 0x2 means dbspace 2, and the 0x002f4 is the logical page #.
If you wanted to look at these partition pages you would use:
oncheck -pp 0x200001 0x2f4
oncheck -pp 0x300001 0x2
oncheck -pp 0x400001 0x2
The first arg above is the address of the main tablespace tablespace page for
each dbspace, the tblspace tblspace tracks all tables (and fragments) in the
dbspace - every dbspace has one and they are all the logical page 1 in the
dbspace, (logical page 0 is a bitmap page). Given any table's partnumber
(partition page number, tablespace tablespace id, etc) you can locate its
actual partition page.
Remember that each tablespace tablespace tracks tables. Look at the first 4
bytes of slot 1 to verify that you have the correct partition page.
Sorry if I confused - I wrote this fast.
Mike
Thank you Mike !!!
>In dbspace #2 you have a partition page whose logical address is 0x2002f4
>In dbspace #3 you have a partition page whose logical address is 0x300002
>In dbspace #4 you have a partition page whose logical address is 0x400002
>oncheck -pp 0x200001 0x2f4
>oncheck -pp 0x300001 0x2
>oncheck -pp 0x400001 0x2
and you are right !!... each oncheck -pp would showes each partnum
in the first 4 bytes of slot 1 ....
What I am curious to know is that ... Why IDS knows nologtest:stkhis
is a fragment table ?!... there should be some flag describe it ~~
in my case , I create fragment table stkhis in dbspace1 and dbspace2 ,
and then create index in dbspace3 , so I'll have 3 partition pages
for table nologtest:stkhis , that is what I know , What I don't know is
where record that this table is fragmented ?! and create index in another
dbspace , there should be a structure describe this ~~~
thanks for your kind response , Mike ..It is nice of you ~~
For fragmented tables the partnum of systables entry is 0 and the
information
about each fragment is stored in sysfragments.
At the disk level the parent partition number will be stored in pn_lock=
id
field in the
partition structure. look at oncheck -pt dbs:table
John F. Miller III
STSM, Support Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)
=
"MARS CHEN" =
<mars@jsun.com> =
Sent by: =
To
ids-bounces@iiug. ids@iiug.org =
org =
cc
=
Subj=
ect
08/28/2008 06:32 Re: Where records the fragment =
PM table's partnum ?! [13249] =
=
=
Please respond to =
ids@iiug.org =
=
=
Thank you Mike !!!
>In dbspace #2 you have a partition page whose logical address is 0x200=
2f4
>In dbspace #3 you have a partition page whose logical address is 0x300=
002
>In dbspace #4 you have a partition page whose logical address is 0x400=
002
>oncheck -pp 0x200001 0x2f4
>oncheck -pp 0x300001 0x2
>oncheck -pp 0x400001 0x2
and you are right !!... each oncheck -pp would showes each partnum
in the first 4 bytes of slot 1 ....
What I am curious to know is that ... Why IDS knows nologtest:stkhis
is a fragment table ?!... there should be some flag describe it ~~
in my case , I create fragment table stkhis in dbspace1 and dbspace2 ,
and then create index in dbspace3 , so I'll have 3 partition pages
for table nologtest:stkhis , that is what I know , What I don't know is=
where record that this table is fragmented ?! and create index in anoth=
er
dbspace , there should be a structure describe this ~~~
thanks for your kind response , Mike ..It is nice of you ~~
***********************************************************************=
********
Forum Note: Use "Reply" to post a response in the discussion forum.
=
Thank you , John ... You help a lot , I got it ...
Besides the system catalog tables, systables and sysfragments, all of the
fragments of a table have the same lockid which is actually the partnum of
the first partition defined for the table or index. Look in
sysmaster:systabnames and sysmaster:sysptnhdr.
Art
On Thu, Aug 28, 2008 at 9:32 PM, MARS CHEN <mars@jsun.com> wrote:
> Thank you Mike !!!
>
> >In dbspace #2 you have a partition page whose logical address is 0x2002f4
> >In dbspace #3 you have a partition page whose logical address is 0x300002
> >In dbspace #4 you have a partition page whose logical address is 0x400002
>
> >oncheck -pp 0x200001 0x2f4
> >oncheck -pp 0x300001 0x2
> >oncheck -pp 0x400001 0x2>
> and you are right !!... each oncheck -pp would showes each partnum
> in the first 4 bytes of slot 1 ....
>
> What I am curious to know is that ... Why IDS knows nologtest:stkhis
> is a fragment table ?!... there should be some flag describe it ~~
>
> in my case , I create fragment table stkhis in dbspace1 and dbspace2 ,
> and then create index in dbspace3 , so I'll have 3 partition pages
> for table nologtest:stkhis , that is what I know , What I don't know is
> where record that this table is fragmented ?! and create index in another
> dbspace , there should be a structure describe this ~~~
>
> thanks for your kind response , Mike ..It is nice of you ~~
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do those
opinions reflect those of other individuals affiliated with any entity with
which I am affiliated nor those of the entities themselves.
True dat Art -
In addition if you look at the output from oncheck -pt the part that says...
Partition partnum 11534338
Partition lockid 10485815
...Will tell you if the table is fragged or not. The Partition partnum entry
corresponds to the first fragment's partnumber, the Partition lockid is the
partnumber for the additional fragment(s) - there will be an entry for each
frag.
MM