index width
Posted in 2006
I'm reading that B-tree indexes don't perform well on wide columns, specifically those above 32bytes.
I'm trying to find out the width of all our indexes. I can't come up with a query to do this, any help ?
I know I have to join systables, syscolumns and sysindexes, and join on sysindexes.part1 etc to syscolumns.colno and then get the collength.
I can pretty much get there with this, but it doesn't group them properly to be able to add up the columns for a multi-column index.
select si.idxname,st.tabname,sc.colname,sc.collength
from sysindexes si,systables st,syscolumns sc
where st.tabid>99 and st.tabname not matches '*[0-9]*'
and st.tabid=si.tabid
and si.tabid=sc.tabid
and (si.part1=sc.colno or si.part2=sc.colno or si.part3=sc.colno)
and st.tabname='proc_stats'
order by sc.collength desc
Thanks for any help.
========================
-<<Floyd Wellershaus>>-
Database Administrator
Unix Administrator
email: fwellers@yahoo.com
Home: 703-430-0805
Cell: 703-477-6045
========================
http://www.one.org/