SlideShare a Scribd company logo
1 of 27
USING
INDEXED FIELDS
EFFECTIVELY IN
ACCESS QUERIES
Alan Manifold
Systems Implementation Manager
Purdue University Libraries
European Endeavor Users Group 2005
Parallel sessions III
10 June 2005
12.00 - 12.45
Using Indexed Fields Effectively in Access Queries
PHONEBOOKS
Aaa—AlaA Ala—Bah A
A phonebook is an
index, but not the
efficient kind you would
want your computer to
use.
The basic lookup
process is a scan from
beginning to end,
looking at the index
tabs at the top of each
page.
Using Indexed Fields Effectively in Access Queries
AN IMPROVEMENT
ABCDEFGHIJKLM NOPQRSTUVWXYZ
ABCDEF GHIJKLM NOPQRS TUVWXYZ
ABC DEF GHI JKLM NOP QRS TUV WXYZ
JK LM
J K L M
N OP
WX YZ
W X Y Z
ABCDEFGHIJKLMNOPQRSTUVWXYZ
This index gets to any letter in a max of 6 tries
A BC D EF G HI
B C E F H I
Q RS T UV
O P R S U V
Bah-Bur Bur-Cam
Using Indexed Fields Effectively in Access Queries
EVEN BETTER
In a B-Tree, each node
can point to a number
of child nodes, so the
disk access is
minimized.
Nodes are (ideally)
sized to make
maximum use of
memory, which is
fast.
Cam-Cop Cop-Des
Using Indexed Fields Effectively in Access Queries
NOT OUR PROBLEM
We don’t have to worry
about how indexes
work, because Oracle
provides them for us.
We just want to make
sure we use them.
Des-Die Die-Ebs
Using Indexed Fields Effectively in Access Queries
WITHOUT INDEXES
The alternative to
using an index is a
“full table scan”. This
means looking at each
record in the database
in turn. Depending on
the size of the table,
this can be very slow.
SELECT BIB_ID
FROM BIB_TEXT
WHERE TITLE
LIKE "*turtles*";
“Let's see… Does record
1 have this? Nope. How
about record 2? Nope.
Record 3? Hmmm…”
Ebs-End End-Fax
Using Indexed Fields Effectively in Access Queries
IDENTIFYING INDEXES
Use the query on the
following slide in
SQL*Plus to identify
what indexes there are
in the Voyager
database.
Fax-Fly Fly-Gba
Using Indexed Fields Effectively in Access Queries
IDENTIFYING INDEXES
SELECT
USER_INDEXES.INDEX_NAME,
USER_INDEXES.TABLE_NAME,
COLUMN_POSITION,
SUBSTR(COLUMN_NAME,1,40) COL_NAME
FROM
USER_INDEXES,
USER_IND_COLUMNS
WHERE USER_INDEXES.INDEX_NAME =
USER_IND_COLUMNS.INDEX_NAME;
Gba-God God-Hel
Using Indexed Fields Effectively in Access Queries
OUR EXAMPLES
TABLE_NAME INDEX_NAME # COLUMN_NAME
ELINK_INDEX ELINK_INDEX_ELINK_ID 1 ELINK_ID
ELINK_INDEX ELINK_INDEX_LINK_NORMAL 1 LINK_TEXT_NORMAL
ELINK_INDEX ELINK_INDEX_RECID_RECTYPE_IDX 1 RECORD_ID
ELINK_INDEX ELINK_INDEX_RECID_RECTYPE_IDX 2 RECORD_TYPE
FINE_FEE FINE_FEE_IDX 1 FINE_FEE_ID
FINE_FEE FINE_FEE_IDX1 1 ITEM_ID
FINE_FEE FINE_FEE_IDX1 2 FINE_FEE_TYPE
FINE_FEE FINE_FEE_IDX1 3 PATRON_ID
FINE_FEE FINE_FEE_IDX1 4 FINE_FEE_BALANCE
FINE_FEE FINE_FEE_IDX1 5 FINE_FEE_ID
FINE_FEE FINE_FEE_PTN_IDX 1 PATRON_ID
FUND FUND_IDX 1 LEDGER_ID
FUND FUND_IDX 2 FUND_ID
FUND FUND_X_CODE 1 NORMAL_FUND_CODE
FUND FUND_X_NAME 1 NORMAL_FUND_NAME
FUND FUND_X_PARENT 1 LEDGER_ID
FUND FUND_X_PARENT 2 PARENT_FUND
We’ll use
these
records
to learn
how to
read the
results.
Hel-Hos Hos-Ico
Using Indexed Fields Effectively in Access Queries
THE SIMPLEST CASE
In this simplest case,
the index covers only
one field. The
COLUMN_POSITION
field is 1, and there is
no 2.
If you add criteria to
the ELINK_ID field or
link from this table to
another by it, the index
will be used and access
will be fast.
TABLE_NAME INDEX_NAME # COLUMN_NAME
ELINK_INDEX ELINK_INDEX_ELINK_ID 1 ELINK_ID
Ico-Inc Inc-Jar
Using Indexed Fields Effectively in Access Queries
A BIT HARDER
TABLE_NAME INDEX_NAME # COLUMN_NAME
FUND FUND_IDX 1 LEDGER_ID
FUND FUND_IDX 2 FUND_ID
In this case, you can
see there is a
COLUMN_POSITION
(#) field value of 2, as
well as one of 1.
If you search this field
by FUND_ID without
LEDGER_ID, it will do a
full table scan. You
must have the field
with position 1 before
it can use the index for
the field in position 2.
Jar-Jun Jun-Kaa
Using Indexed Fields Effectively in Access Queries
THESE CAN’t USE IT …
Because neither
of these two
queries refers to
the LEDGER_ID,
they can’t use
the FUND_IDX
index. They’ll
have to do a full
scan of the FUND
table.
Kaa-Kri Kri-Lap
Using Indexed Fields Effectively in Access Queries
… BUT THESE CAN
These two queries could
both use the FUND_IDX
index, as
they use
the
LEDGER_ID
as well as
the
FUND_ID
Lap-Lib Lib-Llo
Using Indexed Fields Effectively in Access Queries
A HARDER ONE YET
TABLE_NAME INDEX_NAME # COLUMN_NAME
FINE_FEE FINE_FEE_IDX1 1 ITEM_ID
FINE_FEE FINE_FEE_IDX1 2 FINE_FEE_TYPE
FINE_FEE FINE_FEE_IDX1 3 PATRON_ID
FINE_FEE FINE_FEE_IDX1 4 FINE_FEE_BALANCE
FINE_FEE FINE_FEE_IDX1 5 FINE_FEE_ID
To use this index, you
need an ITEM_ID, then
a FINE_FEE_TYPE, then
a PATRON_ID, then the
FINE_FEE_BALANCE,
then the FINE_FEE_ID.
You don’t have to use
all of these fields, but
you must use at least
the ones with smaller
numbers than the field
you’re interested in.
Llo-Max Max-Moo
Using Indexed Fields Effectively in Access Queries
USING THE INDEX
This query can use the
FINE_FEE_IDX1 index
since the first three
fields in the index
(ITEM_ID,
FINE_FEE_TYPE, and
PATRON_ID) are all
being used for links.
Moo-Nal Nal-Not
Using Indexed Fields Effectively in Access Queries
CRITERIA NOTES
Exact criteria such as:
“reference”
and
“ref main” Or “ref branch”
appear to work faster
than fuzzy criteria such
as:
Like “ref*”
Indexes are left-
anchored, so criteria
such as:
Like “*refe”
can’t use the indexes
Not-Oax Oax-Ole
Using Indexed Fields Effectively in Access Queries
THE FUDGE FACTOR
Where I have shown
examples of queries, I
have said the query
“could” or “can” use
the index. Whether it
does or not is up to
Oracle and the ODBC
drivers.
Ole-Opa Opa-Pac
Using Indexed Fields Effectively in Access Queries
EXAMPLE #1
Let’s look at
the indexes
related to this
query and see
how good it
is.
Pac-Pez Pez-Pur
Using Indexed Fields Effectively in Access Queries
THE LINKS WE USED
BIB_TEXT BIB_TEXT_BIB_ID_IDX 1 BIB_ID
LOCATION LOCATION_LOC_ID_IDX 1 LOCATION_ID
BIB_MFHD BIB_MFHD_BIBID_MFHDID_IDX 1 BIB_ID
BIB_MFHD BIB_MFHD_BIBID_MFHDID_IDX 2 MFHD_ID
BIB_MFHD BIB_MFHD_MFHDID_BIBID_IDX 1 MFHD_ID
BIB_MFHD BIB_MFHD_MFHDID_BIBID_IDX 2 BIB_ID
Most of the links we used were on indexed fields.
MFHD_MASTER MFHD_MASTER_MFHD_ID_IDX 1 MFHD_ID
MFHD_ITEM MFHD_ITEM_ITEM_IDX 1 ITEM_ID
MFHD_ITEM MFHD_ITEM_MFHD_IDX 1 MFHD_ID
ITEM ITEM_IDX 1 ITEM_ID
ITEM ITEM_TEMPLOC_PERMLOC_IDX 1 TEMP_LOCATION
ITEM ITEM_TEMPLOC_PERMLOC_IDX 2 PERM_LOCATION
Pur-Qua Qua-Quo
Using Indexed Fields Effectively in Access Queries
THE CRITERIA WE USED
MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 1 NORMALIZED_CALL_NO
MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 2 CALL_NO_TYPE
MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 3 LOCATION_ID
MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 4 SUPPRESS_IN_OPAC
MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 5 MFHD_ID
MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 6 DISPLAY_CALL_NO
MFHD_MASTER MFHD_MASTER_TYPE_IDX 1 CALL_NO_TYPE
MFHD_MASTER MFHD_MASTER_TYPE_IDX 2 MFHD_ID
CALL_NO_TYPE is indexed, but
NORMALIZED_CALL_NO would be a better choice
for criteria than DISPLAY_CALL_NO. In the
LOCATION table, only the LOCATION_ID is
indexed.
Quo-Ram Ram-Rev
Using Indexed Fields Effectively in Access Queries
DOES LOCATION MATTER?
Although neither the
LOCATION_CODE nor
the LOCATION_NAME
are indexed in
LOCATION, it makes
very little difference in
speed. The shorter
field (LOCATION_CODE)
is preferable for
criteria.
In a B-Tree structure,
the nodes are relatively
large, so they have lots
of records in them. For
a small table, a full-
table scan is equivalent
to an index lookup.
Rev-Rip Rip-Ror
Using Indexed Fields Effectively in Access Queries
EXAMPLE #2
Ror-Rug Rug-San
Using Indexed Fields Effectively in Access Queries
ANALYSIS
All the links are on
indexed fields except to
PO_STATUS and
INVOICE_STATUS, which
are too small to count.
The criterion on the
INVOICE_STATUS_DESC
field from the
INVOICE_STATUS table
is okay, too.
San-Sol Sol-Sun
Using Indexed Fields Effectively in Access Queries
EXAMPLE #3
BIB_INDEX BIB_INDEX_BIB_ID_IDX 1 BIB_ID
BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 1 INDEX_CODE
BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 2 NORMAL_HEADING
BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 3 BIB_ID
BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 4 DISPLAY_HEADING
To use BIB_INDEX to get
all titles by an author
(100 or 700 fields),
specify the INDEX_CODE
field as well as the
NORMAL_HEADING field.
4 secs
>5 mins
0 secs
Sun-Tee Tee-Tod
Using Indexed Fields Effectively in Access Queries
EXAMPLE #4
There’s no help for this query. It needs to use
criteria that aren’t indexed anywhere. It will
take a long time to run no matter what.
Tod-Voy Voy-Wah
Using Indexed Fields Effectively in Access Queries
EXAMPLE #5
Not only does
this query
not use the
normalized
last name for
its criterion,
it also
requires the
user to enter
the names in
mixed case.
Wah-Who Who-You
Using Indexed Fields Effectively in Access Queries
SUMMARY
Using indexed fields in
queries is mostly a
matter of common
sense, and is not
difficult. But it can
make a major
difference in the speed
of queries.
You-Zen Zen-Zzy

More Related Content

What's hot

Regular Expression Cheat Sheet
Regular Expression Cheat SheetRegular Expression Cheat Sheet
Regular Expression Cheat SheetSydneyJohnson57
 
MS excel - match function
MS excel - match functionMS excel - match function
MS excel - match functionVincent Segondo
 
4. languages and grammars
4. languages and grammars4. languages and grammars
4. languages and grammarsSaeed Parsa
 
Phone Address Booklet – Dossier Project
Phone Address Booklet – Dossier ProjectPhone Address Booklet – Dossier Project
Phone Address Booklet – Dossier ProjectJohn Smailes
 
Lesson 8 Creating Complex Formulas
Lesson 8   Creating Complex FormulasLesson 8   Creating Complex Formulas
Lesson 8 Creating Complex Formulasguevarra_2000
 
Relational algebr
Relational algebrRelational algebr
Relational algebrVisakh V
 

What's hot (7)

Regular Expression Cheat Sheet
Regular Expression Cheat SheetRegular Expression Cheat Sheet
Regular Expression Cheat Sheet
 
MS excel - match function
MS excel - match functionMS excel - match function
MS excel - match function
 
4. languages and grammars
4. languages and grammars4. languages and grammars
4. languages and grammars
 
Subqueries
SubqueriesSubqueries
Subqueries
 
Phone Address Booklet – Dossier Project
Phone Address Booklet – Dossier ProjectPhone Address Booklet – Dossier Project
Phone Address Booklet – Dossier Project
 
Lesson 8 Creating Complex Formulas
Lesson 8   Creating Complex FormulasLesson 8   Creating Complex Formulas
Lesson 8 Creating Complex Formulas
 
Relational algebr
Relational algebrRelational algebr
Relational algebr
 

Viewers also liked

Starting ms access 2010
Starting ms access 2010Starting ms access 2010
Starting ms access 2010Bryan Corpuz
 
MS Access and Database Fundamentals
MS Access and Database FundamentalsMS Access and Database Fundamentals
MS Access and Database FundamentalsAnanda Gupta
 
MS Office Access Tutorial
MS Office Access TutorialMS Office Access Tutorial
MS Office Access TutorialvirtualMaryam
 
Introduction to microsoft access
Introduction to microsoft accessIntroduction to microsoft access
Introduction to microsoft accessHardik Patel
 
Ms Access ppt
Ms Access pptMs Access ppt
Ms Access pptanuj
 

Viewers also liked (9)

MS Access 2010 tutorial 3
MS Access 2010 tutorial 3MS Access 2010 tutorial 3
MS Access 2010 tutorial 3
 
Alan vs the BLOB
Alan vs the BLOBAlan vs the BLOB
Alan vs the BLOB
 
MS Access 2010 tutorial 5
MS Access 2010 tutorial 5MS Access 2010 tutorial 5
MS Access 2010 tutorial 5
 
Starting ms access 2010
Starting ms access 2010Starting ms access 2010
Starting ms access 2010
 
Ms access 2010
Ms access 2010Ms access 2010
Ms access 2010
 
MS Access and Database Fundamentals
MS Access and Database FundamentalsMS Access and Database Fundamentals
MS Access and Database Fundamentals
 
MS Office Access Tutorial
MS Office Access TutorialMS Office Access Tutorial
MS Office Access Tutorial
 
Introduction to microsoft access
Introduction to microsoft accessIntroduction to microsoft access
Introduction to microsoft access
 
Ms Access ppt
Ms Access pptMs Access ppt
Ms Access ppt
 

Similar to Using Indexed field effectively in Access Queries with Voyager

Goldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL QueriesGoldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL QueriesDave Stokes
 
Optimizing MySQL Queries
Optimizing MySQL QueriesOptimizing MySQL Queries
Optimizing MySQL QueriesAchievers Tech
 
Presentation interpreting execution plans for sql statements
Presentation    interpreting execution plans for sql statementsPresentation    interpreting execution plans for sql statements
Presentation interpreting execution plans for sql statementsxKinAnx
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaperoracle documents
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index TuningManikanda kumar
 
Flexible Indexing with Postgres
Flexible Indexing with PostgresFlexible Indexing with Postgres
Flexible Indexing with PostgresEDB
 
MySQL Performance Optimization
MySQL Performance OptimizationMySQL Performance Optimization
MySQL Performance OptimizationMindfire Solutions
 
Flexible Indexing with Postgres
Flexible Indexing with PostgresFlexible Indexing with Postgres
Flexible Indexing with PostgresEDB
 
Ground Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planGround Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planMaria Colgan
 
Understanding the firebird optimizer
Understanding the firebird optimizerUnderstanding the firebird optimizer
Understanding the firebird optimizerMarius Adrian Popa
 
Building Learning to Rank (LTR) search reranking models using Large Language ...
Building Learning to Rank (LTR) search reranking models using Large Language ...Building Learning to Rank (LTR) search reranking models using Large Language ...
Building Learning to Rank (LTR) search reranking models using Large Language ...Sujit Pal
 
Demystifying Oak Search
Demystifying Oak SearchDemystifying Oak Search
Demystifying Oak SearchJustin Edelson
 
unit 4,Indexes in database.docx
unit 4,Indexes in database.docxunit 4,Indexes in database.docx
unit 4,Indexes in database.docxRaviRajput416403
 
SH 2 - SES 3 - MongoDB Aggregation Framework.pptx
SH 2 - SES 3 -  MongoDB Aggregation Framework.pptxSH 2 - SES 3 -  MongoDB Aggregation Framework.pptx
SH 2 - SES 3 - MongoDB Aggregation Framework.pptxMongoDB
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql queryvuhaininh88
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)Hemant Kumar Singh
 

Similar to Using Indexed field effectively in Access Queries with Voyager (20)

San diegophp
San diegophpSan diegophp
San diegophp
 
Goldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL QueriesGoldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL Queries
 
Optimizing MySQL Queries
Optimizing MySQL QueriesOptimizing MySQL Queries
Optimizing MySQL Queries
 
Presentation interpreting execution plans for sql statements
Presentation    interpreting execution plans for sql statementsPresentation    interpreting execution plans for sql statements
Presentation interpreting execution plans for sql statements
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index Tuning
 
Flexible Indexing with Postgres
Flexible Indexing with PostgresFlexible Indexing with Postgres
Flexible Indexing with Postgres
 
MySQL Performance Optimization
MySQL Performance OptimizationMySQL Performance Optimization
MySQL Performance Optimization
 
Flexible Indexing with Postgres
Flexible Indexing with PostgresFlexible Indexing with Postgres
Flexible Indexing with Postgres
 
Ground Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planGround Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_plan
 
Understanding the firebird optimizer
Understanding the firebird optimizerUnderstanding the firebird optimizer
Understanding the firebird optimizer
 
Building Learning to Rank (LTR) search reranking models using Large Language ...
Building Learning to Rank (LTR) search reranking models using Large Language ...Building Learning to Rank (LTR) search reranking models using Large Language ...
Building Learning to Rank (LTR) search reranking models using Large Language ...
 
Demystifying Oak Search
Demystifying Oak SearchDemystifying Oak Search
Demystifying Oak Search
 
EVOLVE'14 | Enhance | Justin Edelson & Darin Kuntze | Demystifying Oak Search
EVOLVE'14 | Enhance | Justin Edelson & Darin Kuntze | Demystifying Oak SearchEVOLVE'14 | Enhance | Justin Edelson & Darin Kuntze | Demystifying Oak Search
EVOLVE'14 | Enhance | Justin Edelson & Darin Kuntze | Demystifying Oak Search
 
Testing File
Testing FileTesting File
Testing File
 
Indexes overview
Indexes overviewIndexes overview
Indexes overview
 
unit 4,Indexes in database.docx
unit 4,Indexes in database.docxunit 4,Indexes in database.docx
unit 4,Indexes in database.docx
 
SH 2 - SES 3 - MongoDB Aggregation Framework.pptx
SH 2 - SES 3 -  MongoDB Aggregation Framework.pptxSH 2 - SES 3 -  MongoDB Aggregation Framework.pptx
SH 2 - SES 3 - MongoDB Aggregation Framework.pptx
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql query
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
 

More from Alan Manifold

Making materials findable at State Library Victoria, May 2015
Making materials findable at State Library Victoria, May 2015Making materials findable at State Library Victoria, May 2015
Making materials findable at State Library Victoria, May 2015Alan Manifold
 
Deep Links Into Primo
Deep Links Into PrimoDeep Links Into Primo
Deep Links Into PrimoAlan Manifold
 
Making Materials Findable at the State Library of Victoria
Making Materials Findable at the State Library of VictoriaMaking Materials Findable at the State Library of Victoria
Making Materials Findable at the State Library of VictoriaAlan Manifold
 
Some Meditations for Baha'i Elections
Some Meditations for Baha'i ElectionsSome Meditations for Baha'i Elections
Some Meditations for Baha'i ElectionsAlan Manifold
 
Photo retrospective of the life of Rosemary Manifold
Photo retrospective of the life of Rosemary ManifoldPhoto retrospective of the life of Rosemary Manifold
Photo retrospective of the life of Rosemary ManifoldAlan Manifold
 
What Were Once Habits Are Now Vices
What Were Once Habits Are Now VicesWhat Were Once Habits Are Now Vices
What Were Once Habits Are Now VicesAlan Manifold
 
Why I Hope ENCompass Continues to Fail
Why I Hope ENCompass Continues to FailWhy I Hope ENCompass Continues to Fail
Why I Hope ENCompass Continues to FailAlan Manifold
 
Queer Buy for the Straight Li-brary (Endeavor's ENCompass)
Queer Buy for the Straight Li-brary (Endeavor's ENCompass)Queer Buy for the Straight Li-brary (Endeavor's ENCompass)
Queer Buy for the Straight Li-brary (Endeavor's ENCompass)Alan Manifold
 
DigiTool API Project
DigiTool API ProjectDigiTool API Project
DigiTool API ProjectAlan Manifold
 
Evolution of Libraries and Metadata
Evolution of Libraries and MetadataEvolution of Libraries and Metadata
Evolution of Libraries and MetadataAlan Manifold
 
Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...
Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...
Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...Alan Manifold
 
Reports and Forms: the finishing touches for Access Reporting (on the Voyager...
Reports and Forms: the finishing touches for Access Reporting (on the Voyager...Reports and Forms: the finishing touches for Access Reporting (on the Voyager...
Reports and Forms: the finishing touches for Access Reporting (on the Voyager...Alan Manifold
 
Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...
Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...
Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...Alan Manifold
 
Art - advanced reporting techniques
Art - advanced reporting techniquesArt - advanced reporting techniques
Art - advanced reporting techniquesAlan Manifold
 
Access Reports for Tenderfeet (or is that tenderfoots?)
Access Reports for Tenderfeet (or is that tenderfoots?) Access Reports for Tenderfeet (or is that tenderfoots?)
Access Reports for Tenderfeet (or is that tenderfoots?) Alan Manifold
 
A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)Alan Manifold
 
One More Thing: Tweaking and Embellishing Access Queries
One More Thing: Tweaking and Embellishing Access QueriesOne More Thing: Tweaking and Embellishing Access Queries
One More Thing: Tweaking and Embellishing Access QueriesAlan Manifold
 
Breaking the Google Addiction
Breaking the Google AddictionBreaking the Google Addiction
Breaking the Google AddictionAlan Manifold
 
An Abecedary of Access Tips with the Voyager Integrated Library System
An Abecedary of Access Tips with the Voyager Integrated Library SystemAn Abecedary of Access Tips with the Voyager Integrated Library System
An Abecedary of Access Tips with the Voyager Integrated Library SystemAlan Manifold
 
Baha'i Views on Faith and Marriage
Baha'i Views on Faith and MarriageBaha'i Views on Faith and Marriage
Baha'i Views on Faith and MarriageAlan Manifold
 

More from Alan Manifold (20)

Making materials findable at State Library Victoria, May 2015
Making materials findable at State Library Victoria, May 2015Making materials findable at State Library Victoria, May 2015
Making materials findable at State Library Victoria, May 2015
 
Deep Links Into Primo
Deep Links Into PrimoDeep Links Into Primo
Deep Links Into Primo
 
Making Materials Findable at the State Library of Victoria
Making Materials Findable at the State Library of VictoriaMaking Materials Findable at the State Library of Victoria
Making Materials Findable at the State Library of Victoria
 
Some Meditations for Baha'i Elections
Some Meditations for Baha'i ElectionsSome Meditations for Baha'i Elections
Some Meditations for Baha'i Elections
 
Photo retrospective of the life of Rosemary Manifold
Photo retrospective of the life of Rosemary ManifoldPhoto retrospective of the life of Rosemary Manifold
Photo retrospective of the life of Rosemary Manifold
 
What Were Once Habits Are Now Vices
What Were Once Habits Are Now VicesWhat Were Once Habits Are Now Vices
What Were Once Habits Are Now Vices
 
Why I Hope ENCompass Continues to Fail
Why I Hope ENCompass Continues to FailWhy I Hope ENCompass Continues to Fail
Why I Hope ENCompass Continues to Fail
 
Queer Buy for the Straight Li-brary (Endeavor's ENCompass)
Queer Buy for the Straight Li-brary (Endeavor's ENCompass)Queer Buy for the Straight Li-brary (Endeavor's ENCompass)
Queer Buy for the Straight Li-brary (Endeavor's ENCompass)
 
DigiTool API Project
DigiTool API ProjectDigiTool API Project
DigiTool API Project
 
Evolution of Libraries and Metadata
Evolution of Libraries and MetadataEvolution of Libraries and Metadata
Evolution of Libraries and Metadata
 
Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...
Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...
Using Access to Create Reports from Voyager (Microsoft Access with the Voyage...
 
Reports and Forms: the finishing touches for Access Reporting (on the Voyager...
Reports and Forms: the finishing touches for Access Reporting (on the Voyager...Reports and Forms: the finishing touches for Access Reporting (on the Voyager...
Reports and Forms: the finishing touches for Access Reporting (on the Voyager...
 
Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...
Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...
Buried Treasure: Finding Reporting Gold in the Voyager Tables (using Microsof...
 
Art - advanced reporting techniques
Art - advanced reporting techniquesArt - advanced reporting techniques
Art - advanced reporting techniques
 
Access Reports for Tenderfeet (or is that tenderfoots?)
Access Reports for Tenderfeet (or is that tenderfoots?) Access Reports for Tenderfeet (or is that tenderfoots?)
Access Reports for Tenderfeet (or is that tenderfoots?)
 
A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)
 
One More Thing: Tweaking and Embellishing Access Queries
One More Thing: Tweaking and Embellishing Access QueriesOne More Thing: Tweaking and Embellishing Access Queries
One More Thing: Tweaking and Embellishing Access Queries
 
Breaking the Google Addiction
Breaking the Google AddictionBreaking the Google Addiction
Breaking the Google Addiction
 
An Abecedary of Access Tips with the Voyager Integrated Library System
An Abecedary of Access Tips with the Voyager Integrated Library SystemAn Abecedary of Access Tips with the Voyager Integrated Library System
An Abecedary of Access Tips with the Voyager Integrated Library System
 
Baha'i Views on Faith and Marriage
Baha'i Views on Faith and MarriageBaha'i Views on Faith and Marriage
Baha'i Views on Faith and Marriage
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Using Indexed field effectively in Access Queries with Voyager

  • 1. USING INDEXED FIELDS EFFECTIVELY IN ACCESS QUERIES Alan Manifold Systems Implementation Manager Purdue University Libraries European Endeavor Users Group 2005 Parallel sessions III 10 June 2005 12.00 - 12.45
  • 2. Using Indexed Fields Effectively in Access Queries PHONEBOOKS Aaa—AlaA Ala—Bah A A phonebook is an index, but not the efficient kind you would want your computer to use. The basic lookup process is a scan from beginning to end, looking at the index tabs at the top of each page.
  • 3. Using Indexed Fields Effectively in Access Queries AN IMPROVEMENT ABCDEFGHIJKLM NOPQRSTUVWXYZ ABCDEF GHIJKLM NOPQRS TUVWXYZ ABC DEF GHI JKLM NOP QRS TUV WXYZ JK LM J K L M N OP WX YZ W X Y Z ABCDEFGHIJKLMNOPQRSTUVWXYZ This index gets to any letter in a max of 6 tries A BC D EF G HI B C E F H I Q RS T UV O P R S U V Bah-Bur Bur-Cam
  • 4. Using Indexed Fields Effectively in Access Queries EVEN BETTER In a B-Tree, each node can point to a number of child nodes, so the disk access is minimized. Nodes are (ideally) sized to make maximum use of memory, which is fast. Cam-Cop Cop-Des
  • 5. Using Indexed Fields Effectively in Access Queries NOT OUR PROBLEM We don’t have to worry about how indexes work, because Oracle provides them for us. We just want to make sure we use them. Des-Die Die-Ebs
  • 6. Using Indexed Fields Effectively in Access Queries WITHOUT INDEXES The alternative to using an index is a “full table scan”. This means looking at each record in the database in turn. Depending on the size of the table, this can be very slow. SELECT BIB_ID FROM BIB_TEXT WHERE TITLE LIKE "*turtles*"; “Let's see… Does record 1 have this? Nope. How about record 2? Nope. Record 3? Hmmm…” Ebs-End End-Fax
  • 7. Using Indexed Fields Effectively in Access Queries IDENTIFYING INDEXES Use the query on the following slide in SQL*Plus to identify what indexes there are in the Voyager database. Fax-Fly Fly-Gba
  • 8. Using Indexed Fields Effectively in Access Queries IDENTIFYING INDEXES SELECT USER_INDEXES.INDEX_NAME, USER_INDEXES.TABLE_NAME, COLUMN_POSITION, SUBSTR(COLUMN_NAME,1,40) COL_NAME FROM USER_INDEXES, USER_IND_COLUMNS WHERE USER_INDEXES.INDEX_NAME = USER_IND_COLUMNS.INDEX_NAME; Gba-God God-Hel
  • 9. Using Indexed Fields Effectively in Access Queries OUR EXAMPLES TABLE_NAME INDEX_NAME # COLUMN_NAME ELINK_INDEX ELINK_INDEX_ELINK_ID 1 ELINK_ID ELINK_INDEX ELINK_INDEX_LINK_NORMAL 1 LINK_TEXT_NORMAL ELINK_INDEX ELINK_INDEX_RECID_RECTYPE_IDX 1 RECORD_ID ELINK_INDEX ELINK_INDEX_RECID_RECTYPE_IDX 2 RECORD_TYPE FINE_FEE FINE_FEE_IDX 1 FINE_FEE_ID FINE_FEE FINE_FEE_IDX1 1 ITEM_ID FINE_FEE FINE_FEE_IDX1 2 FINE_FEE_TYPE FINE_FEE FINE_FEE_IDX1 3 PATRON_ID FINE_FEE FINE_FEE_IDX1 4 FINE_FEE_BALANCE FINE_FEE FINE_FEE_IDX1 5 FINE_FEE_ID FINE_FEE FINE_FEE_PTN_IDX 1 PATRON_ID FUND FUND_IDX 1 LEDGER_ID FUND FUND_IDX 2 FUND_ID FUND FUND_X_CODE 1 NORMAL_FUND_CODE FUND FUND_X_NAME 1 NORMAL_FUND_NAME FUND FUND_X_PARENT 1 LEDGER_ID FUND FUND_X_PARENT 2 PARENT_FUND We’ll use these records to learn how to read the results. Hel-Hos Hos-Ico
  • 10. Using Indexed Fields Effectively in Access Queries THE SIMPLEST CASE In this simplest case, the index covers only one field. The COLUMN_POSITION field is 1, and there is no 2. If you add criteria to the ELINK_ID field or link from this table to another by it, the index will be used and access will be fast. TABLE_NAME INDEX_NAME # COLUMN_NAME ELINK_INDEX ELINK_INDEX_ELINK_ID 1 ELINK_ID Ico-Inc Inc-Jar
  • 11. Using Indexed Fields Effectively in Access Queries A BIT HARDER TABLE_NAME INDEX_NAME # COLUMN_NAME FUND FUND_IDX 1 LEDGER_ID FUND FUND_IDX 2 FUND_ID In this case, you can see there is a COLUMN_POSITION (#) field value of 2, as well as one of 1. If you search this field by FUND_ID without LEDGER_ID, it will do a full table scan. You must have the field with position 1 before it can use the index for the field in position 2. Jar-Jun Jun-Kaa
  • 12. Using Indexed Fields Effectively in Access Queries THESE CAN’t USE IT … Because neither of these two queries refers to the LEDGER_ID, they can’t use the FUND_IDX index. They’ll have to do a full scan of the FUND table. Kaa-Kri Kri-Lap
  • 13. Using Indexed Fields Effectively in Access Queries … BUT THESE CAN These two queries could both use the FUND_IDX index, as they use the LEDGER_ID as well as the FUND_ID Lap-Lib Lib-Llo
  • 14. Using Indexed Fields Effectively in Access Queries A HARDER ONE YET TABLE_NAME INDEX_NAME # COLUMN_NAME FINE_FEE FINE_FEE_IDX1 1 ITEM_ID FINE_FEE FINE_FEE_IDX1 2 FINE_FEE_TYPE FINE_FEE FINE_FEE_IDX1 3 PATRON_ID FINE_FEE FINE_FEE_IDX1 4 FINE_FEE_BALANCE FINE_FEE FINE_FEE_IDX1 5 FINE_FEE_ID To use this index, you need an ITEM_ID, then a FINE_FEE_TYPE, then a PATRON_ID, then the FINE_FEE_BALANCE, then the FINE_FEE_ID. You don’t have to use all of these fields, but you must use at least the ones with smaller numbers than the field you’re interested in. Llo-Max Max-Moo
  • 15. Using Indexed Fields Effectively in Access Queries USING THE INDEX This query can use the FINE_FEE_IDX1 index since the first three fields in the index (ITEM_ID, FINE_FEE_TYPE, and PATRON_ID) are all being used for links. Moo-Nal Nal-Not
  • 16. Using Indexed Fields Effectively in Access Queries CRITERIA NOTES Exact criteria such as: “reference” and “ref main” Or “ref branch” appear to work faster than fuzzy criteria such as: Like “ref*” Indexes are left- anchored, so criteria such as: Like “*refe” can’t use the indexes Not-Oax Oax-Ole
  • 17. Using Indexed Fields Effectively in Access Queries THE FUDGE FACTOR Where I have shown examples of queries, I have said the query “could” or “can” use the index. Whether it does or not is up to Oracle and the ODBC drivers. Ole-Opa Opa-Pac
  • 18. Using Indexed Fields Effectively in Access Queries EXAMPLE #1 Let’s look at the indexes related to this query and see how good it is. Pac-Pez Pez-Pur
  • 19. Using Indexed Fields Effectively in Access Queries THE LINKS WE USED BIB_TEXT BIB_TEXT_BIB_ID_IDX 1 BIB_ID LOCATION LOCATION_LOC_ID_IDX 1 LOCATION_ID BIB_MFHD BIB_MFHD_BIBID_MFHDID_IDX 1 BIB_ID BIB_MFHD BIB_MFHD_BIBID_MFHDID_IDX 2 MFHD_ID BIB_MFHD BIB_MFHD_MFHDID_BIBID_IDX 1 MFHD_ID BIB_MFHD BIB_MFHD_MFHDID_BIBID_IDX 2 BIB_ID Most of the links we used were on indexed fields. MFHD_MASTER MFHD_MASTER_MFHD_ID_IDX 1 MFHD_ID MFHD_ITEM MFHD_ITEM_ITEM_IDX 1 ITEM_ID MFHD_ITEM MFHD_ITEM_MFHD_IDX 1 MFHD_ID ITEM ITEM_IDX 1 ITEM_ID ITEM ITEM_TEMPLOC_PERMLOC_IDX 1 TEMP_LOCATION ITEM ITEM_TEMPLOC_PERMLOC_IDX 2 PERM_LOCATION Pur-Qua Qua-Quo
  • 20. Using Indexed Fields Effectively in Access Queries THE CRITERIA WE USED MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 1 NORMALIZED_CALL_NO MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 2 CALL_NO_TYPE MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 3 LOCATION_ID MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 4 SUPPRESS_IN_OPAC MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 5 MFHD_ID MFHD_MASTER MFHD_MASTER_NORM_TYPE_LOC_IDX 6 DISPLAY_CALL_NO MFHD_MASTER MFHD_MASTER_TYPE_IDX 1 CALL_NO_TYPE MFHD_MASTER MFHD_MASTER_TYPE_IDX 2 MFHD_ID CALL_NO_TYPE is indexed, but NORMALIZED_CALL_NO would be a better choice for criteria than DISPLAY_CALL_NO. In the LOCATION table, only the LOCATION_ID is indexed. Quo-Ram Ram-Rev
  • 21. Using Indexed Fields Effectively in Access Queries DOES LOCATION MATTER? Although neither the LOCATION_CODE nor the LOCATION_NAME are indexed in LOCATION, it makes very little difference in speed. The shorter field (LOCATION_CODE) is preferable for criteria. In a B-Tree structure, the nodes are relatively large, so they have lots of records in them. For a small table, a full- table scan is equivalent to an index lookup. Rev-Rip Rip-Ror
  • 22. Using Indexed Fields Effectively in Access Queries EXAMPLE #2 Ror-Rug Rug-San
  • 23. Using Indexed Fields Effectively in Access Queries ANALYSIS All the links are on indexed fields except to PO_STATUS and INVOICE_STATUS, which are too small to count. The criterion on the INVOICE_STATUS_DESC field from the INVOICE_STATUS table is okay, too. San-Sol Sol-Sun
  • 24. Using Indexed Fields Effectively in Access Queries EXAMPLE #3 BIB_INDEX BIB_INDEX_BIB_ID_IDX 1 BIB_ID BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 1 INDEX_CODE BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 2 NORMAL_HEADING BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 3 BIB_ID BIB_INDEX BIB_INDEX_CODE_NORM_DISP_IDX 4 DISPLAY_HEADING To use BIB_INDEX to get all titles by an author (100 or 700 fields), specify the INDEX_CODE field as well as the NORMAL_HEADING field. 4 secs >5 mins 0 secs Sun-Tee Tee-Tod
  • 25. Using Indexed Fields Effectively in Access Queries EXAMPLE #4 There’s no help for this query. It needs to use criteria that aren’t indexed anywhere. It will take a long time to run no matter what. Tod-Voy Voy-Wah
  • 26. Using Indexed Fields Effectively in Access Queries EXAMPLE #5 Not only does this query not use the normalized last name for its criterion, it also requires the user to enter the names in mixed case. Wah-Who Who-You
  • 27. Using Indexed Fields Effectively in Access Queries SUMMARY Using indexed fields in queries is mostly a matter of common sense, and is not difficult. But it can make a major difference in the speed of queries. You-Zen Zen-Zzy