July 21, 2005 at 2:20 pm
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
July 21, 2005 at 2:46 pm
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
*****************/
July 21, 2005 at 3:35 pm
and indid = 0 just indicates is the heap which last page is located in the root field
* Noel
July 22, 2005 at 3:59 am
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