You are on page 1of 28

DB-12 - Pick An Index, Any Index

Michael Lonski Allegro Consultants, LTD.

www.allegroconsultants.com

Whats Next
Prepare

www.allegroconsultants.com

Who I Am
Started working with Progress v3 (1986)

Founded Allegro Consultants in 1993


Internationally recognized speaker

Author of Coding Smart book on ADM2


Punster and Frequent Talker

www.allegroconsultants.com

And Why I Am Here


Overview index rules

Practical tools, not bookish theory


Focus on fact, not guesswork

Compile time information


Run-time information Show off skill at alliteration

www.allegroconsultants.com

Whats Next
Prepare

Predict

www.allegroconsultants.com

Hierarchy For A Single Index


1. Unique index with all components 2. 3. 4. 5.

6.

involved in the equality matches Most active equality matches Most active range matches Most active sort matches First index alphabetically by index name The primary index
www.allegroconsultants.com

Multiple Index Usage


If indexes are available for both sides of

WHERE... AND/OR, more than one index can be used Multiple indexes will *only* be used to assist in bracketing records

www.allegroconsultants.com

WHEREAND
WHERE clause includes the use of AND

All components of each index are

involved in equality matches No unique indexes are involved

www.allegroconsultants.com

WHEREOR
WHERE clause includes the use of OR

Both the left and right side of the OR

contain at least the lead component of an index These lead components are involved in either equality or range matches

www.allegroconsultants.com

Whats Next
Prepare

Predict
Prevent

www.allegroconsultants.com

Breaking The Rules

USE-INDEX

FIND WHERE ROWID ( ) =

www.allegroconsultants.com

Breaking The Index


WHERE NOT WHERE Family.CoveredOnBenefits

WHERE MATCHES WHERE IF THEN = vcInput WHERE SUBSTRING () = A ELSE TRUE

www.allegroconsultants.com

Whats Next
Prepare

Predict
Prevent

Plan

www.allegroconsultants.com

XREF Information
COMPILE prog.p XREF prog.xref

FOR EACH
FIND

www.allegroconsultants.com

Demo XREF-demo.p

www.allegroconsultants.com

XREF Information
COMPILE prog.p XREF prog.xref

CREATE
DEFINE Query

Query
www.allegroconsultants.com

Demo Query-demo.p

www.allegroconsultants.com

Whats Next
Prepare

Predict
Prevent

Plan
Prove

www.allegroconsultants.com

If A Query Could Talk


What did I use?

Did I error?

qryCust Did I bracket?

www.allegroconsultants.com

How To Ask
DEFINE VARIABLE vhQryCust AS HANDLE CREATE QUERY vhQryCust

DEFINE QUERY qCust QUERY qCust: qryCust vhQryCust = QUERY qCust:HANDLE

www.allegroconsultants.com

What to Ask
What did I use? vhQry:INDEX-INFORMATION()

Did I error? ERROR-STATUS:NUM-MESSAGES

Did I bracket? qryCust ENTRY(1, vhQry:I-I) = WHOLEINDEX

www.allegroconsultants.com

Demo wQueryTest.w

www.allegroconsultants.com

Whats Next
Prepare

Predict
Prevent

Plan
Prove Process

www.allegroconsultants.com

OpenEdge 10 Log Manager


New features in OpenEdge 10

Both command-line and run-time controls


Highly configurable

www.allegroconsultants.com

Log Manager Controls


Command Line
-clientlog -logentrytypes -logginglevel -numlogfiles -logthreshold

LOG-MANAGER
:LOGFILE -NAME :LOG-ENTRY-TYPES :LOGGING-LEVEL :NUM-LOG-FILES :LOG-THRESHOLD

www.allegroconsultants.com

Demo Logging-demo.p

www.allegroconsultants.com

Now that Ive rambled on, are there any questions?

www.allegroconsultants.com

Thanks for attending

www.allegroconsultants.com

You might also like