Charles, I think that's right - to create other kinds of constraints, there have to be indexes already in place - a foreign key constraint in a child file (detail, say) needs a primary key in the parent file (header in this example). A primary key is not going to be created by the system.

As to why constraints don't show up, I think it's because they are attributes of the table, not separate indexes. They should still be usable in optimization. I might compare this to defining a PF in DDS with K records - that "index" doesn't show up as an LF, right?


On 10/21/2021 4:30 PM, Charles Wilt wrote:
Unique constraints require a unique index...

I'm not aware of any other constraints in which an index would be built by
the system.


On Thu, Oct 21, 2021 at 11:46 AM <stefan@xxxxxxxxxx> wrote:


Beware, I'm in deep water and may have misunderstood most of what I'm
to explain below:

Trying to analyze a bunch of ODBC requests for performance improvements and
my starting point is to compare where-clauses to available indexes.

Found a schema with a bunch of large tables - and to my surprise NO
DSPLIB - no. DSPDBR - no. Went graphical at
:2001/Databases/Schemas/Schema/Indexes - no.

However I found a bunch of constraints named Q_* that can be found at
2001:/ Databases/Schemas/Schema/Tables/Table-right-click/Show indexes.

It seems to me that the SQL manager creates an index for every constraint
being defined and if I run an sql-statement in Visual Explain it actually
uses the Q_* index.


Anyone knows the reason those indexes are not showed up as indexes unless I
right click on the specific table name and click Show Indexes?

Why are they hidden? I can't get usage information etc.

If I'm reasonably right about these indexes being used it seems appropriate
to add a lookup to qsys2.syskeycst in my DB relations analyze program.

If I'm going to loose more hair on this I probably have to start with arms
and legs..




Stefan Tageson

Mobile +46 732 369934

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.