Relation between Page id and File id?

  • Hi All,

    There is a column in sys.sysindexes named 'FIRST', which gives the first or root page. I came across a script which extracted file id from this field in following manner:

    Column 'FIRST' returns value 0xC54CFB020100 for an object, then script extracts 6th and 5th location characters (in this case 'C' and 4), combines them and string becomes C4, converts it to INT and that becomes file id..... I want to know what relation exists between this field and file id, is there any naming convention of pages which contain file number in between their names?

    Thanks in advance.

  • Page numbers are just sequential, starting at 0 and increasing per file. Hence pages are identified by the format 1:43, the 43rd page in file 1.

    p.s. If you want to investigate where pages for an index are, DBCC IND is far better than sysindexes (which is deprecated and will be removed)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply