dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

how to retreive info about indexes through system tables? - informix

This is a discussion on how to retreive info about indexes through system tables? - informix ; hello all here is one way thru dbaccess: echo "info indexes for ;"|dbaccess but how can this be done thru a sql editor hitting the system tables? thanks tom...


Home > Database Forum > Other Databases > informix > how to retreive info about indexes through system tables?

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-12-2008, 01:31 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default how to retreive info about indexes through system tables?

hello all


here is one way thru dbaccess:
echo "info indexes for ;"|dbaccess

but how can this be done thru a sql editor hitting the system tables?


thanks
tom



Reply With Quote
  #2  
Old 11-12-2008, 01:40 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default RE: how to retreive info about indexes through system tables?

Perhaps joining the sysindexes and systables tables on tabid ??

-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of tomcaml@gmail.com
Sent: Wednesday, November 12, 2008 11:31 AM
To: informix-list@iiug.org
Subject: how to retreive info about indexes through system tables?

hello all


here is one way thru dbaccess:
echo "info indexes for ;"|dbaccess

but how can this be done thru a sql editor hitting the system tables?


thanks
tom



_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
Reply With Quote
  #3  
Old 11-12-2008, 05:06 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to retreive info about indexes through system tables?

Tom,

Join systables to sysindexes by tabid and join sysindexes to syscolumns by
the absolute value of the "part*" columns to syscolumns.colno. Each
contains the colno of one of the key columns in the index in order of
appearance. You need to use ABS(part...) because if the column is in the
index DESCENDING then its colno will be negated in sysindexes. This will
not work for 'special' indexes like functional indexes. There you will have
to parse the sysindices table that underlies the sysindexes VIEW (in 9.xx
and later sysindexes is not a table but a view into sysindices). You can
look at the code for my dbschema and dostats utilities to see how to do this
for functional indexes. See the files dostat.ec or myschema.d/
print_indexes.ec in my package utils2_ak which you can download from the
IIUG Software Repository. Feel free to borrow the print_indexes code for
you own applications if you are not producing a commercial product for sale
(then you'll have to negotiate a license with me - sorry).

Art

On Wed, Nov 12, 2008 at 12:31 PM, wrote:

> hello all
>
>
> here is one way thru dbaccess:
> echo "info indexes for ;"|dbaccess
>
> but how can this be done thru a sql editor hitting the system tables?
>
>
> thanks
> tom
>
>
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>



--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.

Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 07:31 PM.