ROWID
Posted in 2004
Why rowid starts from 257 ?
--0__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20 Content-type: multipart/alternative; Boundary="1__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20" --1__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable 257 =3D 0x101 and the ROWID format is 0xLLLLLLSS where L =3D logical pa= ge offset within table and S =3D Slot within the page So, the first row is residing in 1st logical page in slot#1 which is wh= y its decimal 257 .. Thanx much, Rajib Sarkar Advisory Software Engineer DB2/UDB Regional Advanced Support IBM Data Management Group http://www.ibm.com/software/data/db2/udb/winos2unix/support If we all did the things we are capable of doing, we would literally astound ourselves. -- T. Edison = "INDRANIL DEB" = <debindranil@hotm = ail.com> = To Sent by: ids@iiug.org = forum.subscriber@ = cc iiug.org = Subj= ect ROWID [3011] = 05/24/2004 07:10 = AM = = = = = Why rowid starts from 257 ? = --1__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable <html><body> <p>257 =3D 0x101 and the ROWID format is 0xLLLLLLSS where L =3D logical= page offset within table and S =3D Slot within the page<br> <br> So, the first row is residing in 1st logical page in slot#1 which is wh= y its decimal 257 ..<br> <br> Thanx much,<br> <br> Rajib Sarkar<br> Advisory Software Engineer<br> DB2/UDB Regional Advanced Support<br> IBM Data Management Group<br> <a href=3D"http://www.ibm.com/software/data/db2/udb/winos2unix/support"= >http://www.ibm.com/software/data/db2/udb/winos2unix/support</a><br> <br> <br> If we all did the things we are capable of doing, we would literally as= tound ourselves. -- T. Edison<br> <br> <img src=3D"cid:10__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.com" width=3D= "16" height=3D"16" alt=3D"Inactive hide details for "INDRANIL DEB&= quot; <debindranil@hotmail.com>">"INDRANIL DEB" <deb= indranil@hotmail.com><br> <br> <br> <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">= <tr valign=3D"top"><td style=3D"background-image:url(cid:20__=3D88BBE40= DDFC6EA208f9e8a93df938@us.ibm.com); background-repeat: no-repeat; " wid= th=3D"40%"> <ul> <ul> <ul> <ul><b><font size=3D"2">"INDRANIL DEB" <debindranil@hotmai= l.com></font></b><font size=3D"2"> </font><br> <font size=3D"2">Sent by: forum.subscriber@iiug.org</font> <p><font size=3D"2">05/24/2004 07:10 AM</font></ul> </ul> </ul> </ul> </td><td width=3D"60%"> <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">= <tr valign=3D"top"><td width=3D"1%" valign=3D"middle"><img src=3D"cid:3= 0__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.com" border=3D"0" height=3D"= 1" width=3D"58" alt=3D""><br> <div align=3D"right"><font size=3D"2">To</font></div></td><td width=3D"= 100%"><img src=3D"cid:30__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.com" = border=3D"0" height=3D"1" width=3D"1" alt=3D""><br> <font size=3D"2">ids@iiug.org</font></td></tr> <tr valign=3D"top"><td width=3D"1%" valign=3D"middle"><img src=3D"cid:3= 0__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.com" border=3D"0" height=3D"= 1" width=3D"58" alt=3D""><br> <div align=3D"right"><font size=3D"2">cc</font></div></td><td width=3D"= 100%"><img src=3D"cid:30__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.com" = border=3D"0" height=3D"1" width=3D"1" alt=3D""><br> </td></tr> <tr valign=3D"top"><td width=3D"1%" valign=3D"middle"><img src=3D"cid:3= 0__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.com" border=3D"0" height=3D"= 1" width=3D"58" alt=3D""><br> <div align=3D"right"><font size=3D"2">Subject</font></div></td><td widt= h=3D"100%"><img src=3D"cid:30__=3D88BBE40DDFC6EA208f9e8a93df938@us.ibm.= com" border=3D"0" height=3D"1" width=3D"1" alt=3D""><br> <font size=3D"2">ROWID [3011]</font></td></tr> </table> <table border=3D"0" cellspacing=3D"0" cellpadding=3D"0"> <tr valign=3D"top"><td width=3D"58"><img src=3D"cid:30__=3D88BBE40DDFC6= EA208f9e8a93df938@us.ibm.com" border=3D"0" height=3D"1" width=3D"1" alt= =3D""></td><td width=3D"336"><img src=3D"cid:30__=3D88BBE40DDFC6EA208f9= e8a93df938@us.ibm.com" border=3D"0" height=3D"1" width=3D"1" alt=3D""><= /td></tr> </table> </td></tr> </table> <br> <tt>Why rowid starts from 257 ?<br> <br> </tt><br> </body></html>= --1__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20-- --0__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20 Content-type: image/gif; name="graycol.gif" Content-Disposition: inline; filename="graycol.gif" Content-ID: <10__=88BBE40DDFC6EA208f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYXJ0U2F2ZXIhAAA7 --0__=88BBE40DDFC6EA208f9e8a93df938690918c88BBE40DDFC6EA20 Content-type: image/gif; name="pic30012.gif" Content-Disposition: inline; filename="pic30012.gif" Content-ID: <20__=88BBE40DDFC6EA208f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZeZgLVA9YVCpnGagVjV171aRVrYR RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFilKQdI8GA5IcpApeJQt8L09lmgkH LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d5VyKtCKW3jfz4uMKmq3xu4N0nK BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZlqWmyFy5/6yBBuji0AxFR M00oQAqNIstqI6qKHUsWRAEAvagsmfUEAImyxgbmUpJk3IklNUtJOUAVLoUr1+wqDGTE4zk+T6FG uQb3SizBCwatiiUgCBN8vrz+zFjVyQ8FWkOlg4NQiZMB5QS8QO3mpOaKnL0Z2EKvNMSILEThKhCg zMKPVxYJh23qm9KNW7pArPynMqZDiErsTMqI+LRi3QAgkFUbXpuFKhSYZALd0O5RKa2z9EYKBbpb qxIKsjUPRgD7I2XYV6wyrOw92ykExP8NW4URhknC5dKGE4v4NENQj2jXjmfNgOZDaXb5glRmXQ33 YEWQYNcZFnrYcIQLNzyTFDQNkXIff0ExVlY4srziQk43inZgL4rwxxINMvpFFAz1KOODHiu+4aEw NEjFl5B3JIK
In tables that are not fragmented rowid is a 4 byte number the first three bytes are the logical page within the tablespace the last byte is the slot within the page Page 1 slot 1 - 0x00000101 - 257. Not all number will be used - large row size ( 1 per page ) will only use 1 out of every 256 numbers ( minus index pages bitmap pages .....) In fragmented tables rowid is actually a hidden serial ( for most purposes this is close enough to the truth ). This information is covered in the manuals under page formats in good detail. George -----Original Message----- From: forum.subscriber@iiug.org [mailto:forum.subscriber@iiug.org] On Behalf Of INDRANIL DEB Sent: Monday, May 24, 2004 7:10 AM To: ids@iiug.org Subject: ROWID [3011] Why rowid starts from 257 ?