Re: tblspace number and rowid
Posted in 1997
In article <E64B4x.MFp@nonexistent.com>, Jacob Salomon
<jake@apparel.net> writes
>My previous post got no responses at all and vanished suspiciously
>quickly, so I am reposting.
>
>Hi Y'all,
>
>Tim Jones's posted question on "Selecting Locked rows" got me thinking,
>a grave offense! The hamsters are threatening job actions! ;)
>
Oh no - soon there'll be total gerbil-nuclear warfare.
>The setup:
>Pre-Fragmentation, we were always able to select the rowid of a row in
>any table and locate where on disk that is.
>eg: select hex(rowid) hrid, customer_num from customer
>
>By looking at the rowid, I could see the logical page number relative to
>the table. Using that number, and info in oncheck -pt, I could find the
>page containing each customer row. I have used this kind of information
>in the past to pinpoint corruption in data and index pages.
>
Correct. Informix Online Administrators Guide Version 5.0,
Page 2-112. Rowid = 4 byte integer, 1st 3 bytes = logical page
number,last byte = slot table number on the page.
>With the new meaning of rowid in fragmented tables - the simple integer
>unique key - selecting rowid gives no such help. In order to locate the
>row physically, I would need to know the tbspace number as well as the
>rowid. Getting the partition number is difficult for fragment - by -
>expression; it borders on impossible for round-robin fragmentation! And
>then I'd still have only part of what I'm looking for!
>
>The question:
>1. Is there any expression I can use in the SELECT statement to obtain:
> a. The tblspace number (partition ID) of the partition containing the
> fetched row?
I was thinking more a getting the fragment id for the row - surely
each fragement has a unique fragid somewhere or am I just imagining it?
I can't fina anything useful io $INFORMIXDIR/etc/sysmaster.sql which
is used to create the sysmaster database.
> b. The true rowid - logical page number, slot number - of the fetched
> row?
>
No as rowids no longer exist!!!
>If this is to be possible, I suspect it would involve the ability to
>read that "rowid" index directly. So, the next question is:
>
>2. Is there any way to read that index and allow me to get at the
> partition and rowid information?
>
>Thanks for any satisfactory answers
>
I think there is some confusion here. 7.x only, supports fragemented
tables with rowids if you do create table x(..) with rowids.
You then cannot have a serial column in the table. All with with
rowids option does is automatically add a serial column named rowid to
the table as well as only columns defined for the table. This 7.x rowid
column has no relation to pre 7.x rowids, it is just an ordinary
serial column. The with rowids option is just there for lazy dbas who
cannot be bothers to type in the word serial next to the word rowid!!!
--
David Williams