Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Group functions and indexes
This is a multi-part message in MIME format.
------=_NextPart_000_0057_01C021BE.F0DEA5C0 Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Group functions and indexesThe where clause will determine if the index = will be used or not. I'm not sure what version of the rdbms you are = using and what your optimizer mode is. If the rule based optimizer is = in effect then the index should be used. In most organizations your = concern over the non-uniqueness of the index would be fully justified = :-). If the optimizer is in choose mode then statistics might affect a = more complex query, but in this case the index will probably still be = the least costly method of executing the query. Salary would serve no = purpose in the index as it does not serve in the query's where clause.
Allan
If I have a query...=20
select max(salary) from employee=20
where emp_id =3D :emp_id;=20
The table has about 4 million rows; non-unique index on emp_id...=20
What is going on internally? What effect does the group function MAX = have on the search? What about the non-unique index on emp_id? The index = is being used but I'm concerned about its uniqueness (or lack thereof.) = Should SALARY be included in the index even though it isn't a predicate = in the where clause?
I have looked on MetaLink and TechNet to no avail...=20
Thanks in advance!=20
Val=20
Valerie H. Webber
Management Systems Designers, Inc=20
Database Administrator
Valerie.H.Webber_at_irs.gov
704-569-1002 x107=20
------=_NextPart_000_0057_01C021BE.F0DEA5C0 Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Group functions and indexes</TITLE> <META http-equiv=3DContent-Type content=3D"text/html; =charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>The where clause will determine if the =index will=20
<DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Allan</FONT></DIV> <BLOCKQUOTE=20
face=3D"Comic Sans MS" color=3D#000080 size=3D1>Management Systems =
Designers,=20
Inc</FONT> <BR><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D1>Database=20
Administrator</FONT><FONT face=3DArial =
color=3D#000000><BR></FONT><FONT=20
face=3D"Comic Sans MS" color=3D#000080 =
size=3D1>Valerie.H.Webber_at_irs.gov</FONT><FONT=20
face=3DArial color=3D#000000><BR></FONT><FONT face=3D"Comic Sans MS" =
color=3D#000080=20
size=3D1>704-569-1002 x107</FONT><FONT face=3DArial color=3D#000000>=20
Received on Mon Sep 18 2000 - 22:22:33 CDT
![]() |
![]() |