The optimizer can use the first index over A, B, C, D, but it would be
(slightly) faster when it could use an index over A, B, D.
For SELECT C, D, Sum(X)
FROM YourFile
Where A = 2 and B = 5
Group By C, D
The first index might be okay.
For SELECT D
FROM YourFile
Where A='Y', B=5
Group By D
The advised index might be better
The advises are the result of the analysis of any SQL statement that is
executed.
It is up to you to decide whether you need the second index or may work only
with the first one.
Speed when executing a SQL statement versus the additional time necessary
for updating the indexes with each Insert/Update/Delete statement.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization ? Education ? Consulting on IBM i
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
DEnglander--- via MIDRANGE-L
Sent: Mittwoch, 31. August 2022 22:44
To: midrange-l@xxxxxxxxxxxxxxxxxx
Cc: DEnglander@xxxxxxxxxxxxxxx
Subject: Index Advisor question
I created an index over a file with key fields A, B, C, and D.
The index advisor continues to report it recommends as KEYS ADVISED A B D
with ORDER INDEPENDENT as A B
Even though my index contains field C, does the index I created with field C
in it not satisfy the Index Advisor?
Thank you,
Doug
"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the attachments
accompanying it) contain confidential information belonging to the sender.
The information is intended only for the use of the intended recipient. If
you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in reliance on
the contents of the information is strictly prohibited. Any unauthorized
interception of this transmission is illegal under the law. If you have
received this transmission in error, please promptly notify the sender by
reply e-mail, and then destroy all copies of the transmission."
--
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,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.