Sei sulla pagina 1di 2

1.

II most queries access a subset oI a very large table, consider splitting the table into
two or more tables Ior better perIormance.

2 !oln lndexes can be used

3 use lnuLxLS

AL1L8 1A8LL

4 ?ou can use Lhe AL1L8 1A8LL sLaLemenL Lo change Lhe sLrucLure of an exlsLlng Lable Lo
lmprove sysLem performance and reduce sLorage space requlremenLs

CCM8LSSlCn

3 value LlsL Compresslon (vLC) provldes Lhe 1eradaLa daLabase wlLh Lhe capaclLy Lo supporL
mulLlple value compresslon for flxed wldLh columns up Lo 233 dlsLlncL values (plus nuLL)
may be compressed per flxedwldLh column

CC88LLA1Lu Su8CuL8?

6 A subquery ls correlaLed when lL references Lhe columns of ouLer Lables ln Lhe encloslng
(ouLer) query A correlaLed subquery (CS) allows a row ln Lhe lnner query Lo refer Lo a row ln
Lhe ouLer query
A correlaLed subquery ellmlnaLes Lhe need for lnLermedlaLe or Lemporary Lables whlch
cannoL be opLlmlzed and enables Lhe CpLlmlzer Lo choose Lhe form LhaL provldes Lhe besL
performance
rocesslng of a query wrlLLen wlLh CS ls slgnlflcanLly fasLer Lhan Lhe same query uslng
Lemporary Lables

ExampIe 1
ou want to Iind the employee(s) with the highest salary in each department. Enter:
SELECT lastname
,salaryamount
FROM employee ee
WHERE salaryamount
(SELECT MAX (salaryamount)
FROM employee em
WHERE ee.departmentnumber
em.departmentnumber);
This query executes as Iollows:
1 Read the Iirst employee row.
2 Get the max department salary speciIied in the subquery.
3 Compare salary to max salary.
4 II equal, output this row.
5 Go to 1.

CCnCA1LnA1lCn

7 ConcaLenaLlon allows you Lo reLrleve daLa correlaLed Lo Lhe Mln/MAx funcLlon ln a slngle
pass




1C n 8CW C1lCn

8 As an opLlon Lo Lhe SLLLC1 sLaLemenL Lhe 1C n resLrlcLs auLomaLlcally Lhe ouLpuL of
querles Lo a cerLaln number of rows 1hls opLlon provldes a fasL way Lo geL a small sample of
Lhe daLa from a Lable wlLhouL havlng Lo scan Lhe enLlre Lable
lor besL performance use Lhe 1C n opLlon lnsLead of Lhe CuALll? clause wlLh 8Ank or
8CW_nuM8L8 ln besL cases Lhe 1C n opLlon provldes beLLer performance ln worse
cases Lhe 1C n opLlon provldes equlvalenL performance

8LCu8SlvL CuL8lLS

9 A recurslve query ls a way Lo query hlerarchles of daLa such as an organlzaLlonal sLrucLure
- uslng a recurslve query shows a slgnlflcanL performance lmprovemenL over uslng
Lemporary Lables wlLh a sLored procedures ln mosL cases Lhere ls a hlghly slgnlflcanL
lmprovemenL
- uslng Lhe Wl1P 8LCu8SlvL clause has baslcally Lhe same or equlvalenL performance as
uslng Lhe 8LCu8SlvL vlLW

CASL S1AMLn1

10CASL expresslons help lncrease performance 1hey reLurn mulLlple resulLs ln a slngle pass
over Lhe daLa raLher Lhan maklng mulLlple passes over Lhe daLa and Lhen uslng Lhe cllenL
appllcaLlon Lo comblne Lhem lnLo a slngle reporL

AnAL?1lCAL lunC1lCnS

111eradaLa supporL for analyLlcal funcLlons allows you Lo perform compuLaLlons aL Lhe SCL
level raLher Lhan Lhrough a hlgherlevel calculaLlon englne

CCLLLC1 S1A1S

12SLaLlsLlcs are daLa demographlcs lnpuL Lo Lhe CpLlmlzer uses CollecLlng sLaLlsLlcs ensures
LhaL Lhe CpLlmlzer wlll have Lhe mosL accuraLe lnformaLlon Lo creaLe Lhe besL access and
[oln plans

LxLAln LAn

13g 187

Potrebbero piacerti anche