INDEX CONFUSION

  • I'm trying to look at some issues we're having with one of our dbs.  I thought perhaps a better index strategy might be beneficial.  I wrote one query to see what existed on this table and when I executed the helpindex the answer was different.  Can anyone help with my confusion???

    The statements I ran:

    select s1.[name] as table_name, s2.[name] as index_name, indid, ROWCNT

    from sysobjects as s1

    join sysindexes as s2

    on s1.[id] = s2.[id]

    where s1.xtype = 'u'

     AND S1.[NAME] = 'AP_01APInvoiceTaxDetail'

    order by table_name

    EXEC SP_HELPINDEX 'AP_01APInvoiceTaxDetail'

    The results from my query:

    Table_Name                     Index_Name                               indid     rowcnt

    AP_01APInvoiceTaxDetail    AP_01APInvoiceTaxDetail                      0   1

    AP_01APInvoiceTaxDetail    K1_AP_01                                           2   0

    AP_01APInvoiceTaxDetail    _WA_Sys_VendorNumber_1A2C5433        3   0

    AP_01APInvoiceTaxDetail    _WA_Sys_InvoiceNumber_1A2C5433        4   0

    AP_01APInvoiceTaxDetail    _WA_Sys_ScheduleSEQNumber_1A2C5433 5  0

    AP_01APInvoiceTaxDetail    _WA_Sys_TaxCode_1A2C5433                 6 0

    AP_01APInvoiceTaxDetail    _WA_Sys_TaxClass_1A2C5433                 7 0

    The results from sp_helpindex

    K1_AP_01 nonclustered, unique located on PRIMARY Division, VendorNumber, InvoiceNumber, ScheduleSEQNumber, TaxCode, TaxClass

    Am I just being an idiot???

    Thanks ever so much,

    lmp

     

  • what you are seeing are the statistics that SQL Server creates automatically.

    /*****************

    If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek

    *****************/

  • and indid = 0 just indicates is the heap which last page is located in the root field

     


    * Noel

  • Thanks!  I thought it was something like that but wasn't sure.

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

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