467,136 Members | 1,393 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,136 developers. It's quick & easy.

Tables without indexes

Hello!

Is there a way to find out, using an SQL statement, which tables in a
DB2 database have no indexes created on them?

My environment is DB2 UDB V7.2 Fixpak 6 on AIX 4.3.3

Thank you
Nov 12 '05 #1
  • viewed: 2421
Share:
2 Replies
"Demetris" <DM***@laiki.com> wrote in message
news:c5**************************@posting.google.c om...
Hello!

Is there a way to find out, using an SQL statement, which tables in a
DB2 database have no indexes created on them?

My environment is DB2 UDB V7.2 Fixpak 6 on AIX 4.3.3

Thank you


You can query the DB2 catalog views. Check out the SQL Reference in the
appendix for a description of the Catalog Views. The two tables (really
views) that you want to access are syscat.tables and syscat.indexes. I will
not spoil the fun you will have in writing the SQL statement yourself. The
required SQL should be fairly easy to figure out if you look at the Catalog
Views.
Nov 12 '05 #2
Demetris wrote:

Hello!

Is there a way to find out, using an SQL statement, which tables in a
DB2 database have no indexes created on them?

My environment is DB2 UDB V7.2 Fixpak 6 on AIX 4.3.3

Thank you


select tabname from syscat.tables t where type = 'T' and tabschema =
'<your_schema>' and not exists (select tabname from syscat.indexes i
where i.tabname = t.tabname)

--
Dieter Wagner Di***********@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
Durmersheim, Germany
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Molly | last post: by
3 posts views Thread by MaRCeLO PeReiRA | last post: by
10 posts views Thread by Jim Devenish | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.