Subject | Re: Indexes on fields |
---|---|
Author | Ed Dressel |
Post date | 2007-02-23T13:13:14Z |
> If I have problems with this approach then I would try the combinationI tried the following, and was quite surprised by the results. (Note
> of the pairs.
that I disconnect and shut the service down between trials).
select count(*) from ClientInfo
where (Upper_LastName = 'SOME') and (Upper_FirstName = 'NAME')
Plan
PLAN (CLIENTINFO INDEX (CLIENTINFO_IDX5))
Adapted Plan
PLAN (CLIENTINFO INDEX (CLIENTINFO_IDX5))
------ Performance info ------
Prepare time = 47ms
Execute time = 62ms
Avg fetch time = 62.00 ms
Current memory = 721,344
Max memory = 850,832
Memory buffers = 2,048
Reads from disk to cache = 35
Writes from cache to disk = 0
Fetches from cache = 61
Then without the indexes:
select count(*) from ClientInfo
where Upper(Last_Name) = 'SOME' and Upper(First_Name) = 'NAME'
Plan
PLAN (CLIENTINFO NATURAL)
Adapted Plan
PLAN (CLIENTINFO NATURAL)
------ Performance info ------
Prepare time = 31ms
Execute time = 125ms
Avg fetch time = 125.00 ms
Current memory = 712,216
Max memory = 850,832
Memory buffers = 2,048
Reads from disk to cache = 1,592
Writes from cache to disk = 0
Fetches from cache = 17,016
I can not imagine why the two are even close--but maybe 2x speed
improvement is all I will get with adding an index.
Is this typical?