1.Instead of a logical file, create and SQL index.
2.First specify the fields that are selected with an equal sign (i.e. Where
F4='ABC' and F5=123) after specify the fields used within the group by
clause.
3.Specify the most selective field first.
For more information read the following white paper:
Indexing and statistics strategies for DB2 for i5/OS
http://www-03.ibm.com/servers/enable/site/education/abstracts/indxng_abs.htm
l
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"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!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Tomasz Skorza
Gesendet: Monday, 04. January 2010 14:36
An: midrange-l@xxxxxxxxxxxx
Betreff: Structure of logical file for query
Hi and happy New Year for everybody :-)
I would like to ask you how you create keyed fields for logical file for
get the fastest "access".
I have such query
Select F1, F2, F3
From File1
Where
F4, F5, F6
Group By F1, F2, F3
Order by F1, F2, F3
I looking in many web pages but everywhere description of creating LF is
general - "Logicals are important to improve performance"
But what should be an order of keyed fields?
What if query change to:
Select F1, F2, F3
From File1
Where
F4, F5, F6
Group By F7, F8, F9
Order by F9, F8, F7
Which statement are most important? Probably "WHERE" ... but order
should be F4/F5/F6 or other (F6/F5/F4)?
Do you remember a web pages where it is described exactly?
As an Amazon Associate we earn from qualifying purchases.