us 20130013586

Upload: david19775891

Post on 04-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Us 20130013586

    1/13

    US 20130013586A11 9 ) United S t a t e s1 2 ) Patent Application Publication 1 0 ) P u b . N o . : US 2 0 1 3 / 0 0 1 3 5 8 6 A 1

    Muras e t a l . 4 3 ) P u b . D a t e : J a n . 1 0 , 2013( 5 4 )

    ( 7 5 )

    ( 7 3 )( 2 1 )( 2 2 )

    ( 6 3 )

    DATABASE SQLQUERY > PARSER

    METHODAND SYSTEMFORDATAMININGFORAUTOMATICQUERYOPTIMIZATIONI n v e n t o r s : B r i a n Robert Muras, R o c h e s t e r , MN( U S ) ; John Matthew S a n t o s u o s s o ,R o c h e s t e r , MN U )

    I n t e r n a t i o n a l Business MachinesC o r p o r a t i o n , A r m o n k , NY U S )

    A s s i g n e e :A p p 1 . N o . : 1 3 / 6 1 8 , 6 8 0F i l e d : S e p . 1 4 , 2 0 1 2

    R e l a t e d US. p p l i c a t i o n DataC o n t i n u a t i o n o f a p p l i c a t i o n N o . 1 0 / 9 1 1 , 8 4 9 , ? l e d onA u g . 5 , 2 0 0 4 .

    48PARSEL)S T A I H W E N I

    4 6 4 0

    P u b l i c a t i o n C l a s s i ? c a t io n( 5 1 ) I n t . C l .

    G06F 7 / 3 0 ( 2 0 0 6 . 0 1 )(52) us. 1. . . . . . . . . . . . . . . . . . 707/714;707/718;707/E17.014( 5 7 ) ABSTRACTA a t a b a s e m o n i t o r t r a c k s p e r f o r m a n c e s t a t i s t i c s a n d i n f o rm a t i o n a b o u t t h e e x e c u t i o n o f d i f f e r e n t SQL s t a t e m e n t s . Aq u e r y o p t i m i z e r b e n e ? t s f r o m t h e s e s t a t i s t i c s When e n e r a ti n g a n a c c e s s p l a n . I n p a r t i c u l a r , t h e q u e r y o p t i m i z e r , uponr e c e i v i n g a n SQL t a t e m e n t , s e a r c h e s t h e r e c o r d s o f t h e d a t ab a s e m o n i t o r f o r s i m i la r SQL t a t e m e n t s t h a t h a v e p r e v i o u s l yb e e n e x e c u t e d . As a r t o f d e t e r m i n i n g t h e b e s t a c c e s s p l a n f o rt h e c u r r e n t SQL t a t e m e n t , t h e q u e r y o p t i m i z e r c o n s i d e r s t h ei n f o r m a t i o n r e t r i e v e d from h e d a t a b a s e m o n i to r . I n h i s W a y ,t h e a c c e s s p l a n t h a t i s g e n e r a t e d c a n a u t o m a t i c a l l y b e t u n e db a s e d on e m p i r i c a l p e r f o r m a n c e e v i d e n c e .

    5 0EXECUTIONPLAN

    4 4OPTIMIZER DATABASEENGINE

    DATABASEMONITOR

    i 2

  • 8/13/2019 Us 20130013586

    2/13

  • 8/13/2019 Us 20130013586

    3/13

    P a t e n t A p p l i c a t i o n P u b l i c a t i o n J a n . 1 0 , 2 0 1 3 S h e e t 2 0 f 5

    DATABASE NGINE EXECUTES SQL STATEMENTSANDTRACKSPERFORMANCE TATISTICS

    NEW QL STATEMENTRECEIVED

    QUERY OPTIMIZER STARTS TOGENERATEACCESSPLAN

    SEARCHPERFORMANCE STATISTICS FORSIMILAR SQL STA T MENTS

    USE STATISTICS FROM SIMILAR STATEMENITS)WHEN GENERATING THEACCESS PLAN

    FIG. 3

    US 013/0013586 A 1

    3 0 2

    3 0 4

    3 0 6

    308

    3 1 0

  • 8/13/2019 Us 20130013586

    4/13

    P a t e n t A p p l i c a t i o n P u b l i c a t i o n J a n . 1 0 , 2013 S h e e t 3 0 f 5 US 2 0 1 3 / 0 0 1 3 5 8 6 A 1

    4 U 2OPTIMIZER

    RECEIVES SQLQUERY

    NO I S ACCESSPLAN YESALREADYA V A I L A B L E

    SEARCH DATABASE 4 4 y

    F O R S I M I L A R S Q L A Q I E S E S I S I I Z X I Z I B RDERY IQ 408 EXECUTIONi 4 6

    RETRIEVEPERFORMANCESTATISTICS ANDINFORMATION 41 0id

    VERIFYEXECUTIONPERFORMANCEWAS CC EPT A B L E 4 1 2

    lGENERA IE CURRENTACCESS PLAN USINGPERFORMANCEINFORMATION 4 1 4

    EXECUTEACCESSPLAN

    4 1 6FIG. 4

  • 8/13/2019 Us 20130013586

    5/13

    P a t e n t A p p l i c a t i o n P u b l i c a t i o n J a n . 1 0 , 2 0 1 3 S h e e t 4 0 f 5 US 013/0013586 A 1

    QUERY P T I I V I I Z E R RECEIVES SQLSTATEMENT

    502

    THIS STATEMENTIDENTIFY PREVIOUSLY DEVELOPED ACCESS PLAN( ) FOR

    504

    V 5 0 6IDENTIFY REcoRnIs) WITHIN THE DATABASE I H A IRE L A T E TO HESE ACCESS PLAN(S)

    i 5 0 8DETERMINE FROM HE RECORD(S) W I I E I I I E R EXECUTION

    PERFORMANCE WASACCEPTABLENO YES

    V 5 0 5 2FORCE USE THE ACCESS PLAN

    R E - O P T I M I Z I X T I O N TO To EXECUTE I H EGENERATE \ I ; W ACCESS QUERYPIAN

    5 1 4ADJ ST E S I I M A I E DRUN TIMEFOR

    ORIGINAL ACCESS PLAN

    FIG. 5

  • 8/13/2019 Us 20130013586

    6/13

    P a t e n t A p p l i c a t i o n P u b l i c a t i o n J a n . 1 0 , 2013 S h e e t 5 0 f 5 US 2 0 1 3 / 0 0 1 3 5 8 6 A 1

    602IDENTIFY FROMDATABASEHOSTVARIABLES

    USED N QUERIES WITHPOOR PERFORMANCE

    QUERY OPTIMIZERRECEIVES AN SQL I A I E ME N I

    TSTARTTO GENERATEACCESSPLAN

    T* ARECURRENTHOST VARIABLES N THE IST OF:5 IDENTIFIED HOST ARIABLES? N0

    6 0 4

    606

    608

    FORCE E-OPTIMIZATION TOENSUREANEWACCESS PLAN S

    GENERATEDCONTINUE GENERATING CCESSPLAN N THENORMAL MANNER

    610 612

    FIG. 6

  • 8/13/2019 Us 20130013586

    7/13

    US 013/0013586 A 1

    METHODAND SYSTEM FOR DATAMININGFORAUTOMATICQUERYOPTIMIZATION

    CROSS-REFERENCETO RELATEDAPPLICATIONS

    [ 0 0 0 1 ] T h i s a p p l i c a t i o n i s a c o n t i n u a t i o n o f US. p a t e n ta p p l i c a t i o n S e r . N o . 1 0 / 9 1 1 , 8 4 9 , ? l e d o n A u g . 5 , 2 0 0 4 b yB r i a n R o b e r t Muras t a l . (ROC920030406US1), t h e e n t i r ed i s c l o s u r e o f W h i c h i s i n c o r p o r a t e d b y r e f e r e n c e h e r e i n .

    FIELD OFTHE INVENTION[ 0 0 0 2 ] The i n v e n t i o n r e l a t e s t o d a t a b a s e management s y st e m s , a n d i n p a r t i c u l a r , t o q u e r y o p t i m i z e r s .

    BACKGROUND OFTHE INVENTION[ 0 0 0 3 ] Databases a r e used o s t o r e information o r an innum e r a b l e number f a p p l i c a t i o n s , i n c l u d i n g v a r i o u s commerc i a l , i n d u s t r i a l , t e c h n i c a l , s c i e n t i ? c a n d e d u c a t i o n a l a p p l i c at i o n s . As t h e r e l i a n c e on i n f o r m a t i o n i n c r e a s e s , b o t h t h evolume of n f o r m a t i o n s t o r e d i n most a t a b a s e s , a s W e l l a s t h enumber f u s e r s W i s h i n g t o a c c e s s t h a t i n f o r m a t i o n , l i k e W i sei n c r e a s e s . Moreover, a s t h e volume of n f o r m a t i o n i n a d a t ab a s e , and h e number f s e r s W i s h i n g t o a c c e s s t h e d a t a b a s e ,i n c r e a s e s , t h e amount o f c o m p u t i n g r e s o u r c e s r e q u i r e d tomanage such a database i n c r e a s e s a s W e l l .[ 0 0 0 4 ] D a t a b a s e m a n a g e m e n t s y s t e m s ( D B M S s ) , W h i c ha r e t h e comp uter programs t h a t a r e used t o a c c e s s t h e i n f o rm a t i o n s t o r e d in d a t ab a s e s, t h e r e f o r e o f t e n r e q u i r e t r e m e ndous e s o u r c e s to h a n d l e t h e heavy Workloads l a c e d on u c hs y s t e m s . As s u c h , s i g n i ? c a n t r e s o u r c e s h a v e been d e v o t e d toi n c r e a s i n g t h e p e r f o r m a n c e o f d a t a b a s e m a n a g e m e n t s y s t e m sW i t h r e s p e c t t o p r o c e s s i n g s e a r c h e s , o r q u e r i e s , t o d a t a b a s e s .[ 0 0 0 5 ] I m p r o v e m e n t s t o b o t h c o m p u t e r h a r d W a r e a n d s o f tWare a v e i m p r o v e d t h e c a p a c i t i e s o f c o n v e n t i o n a l d a t a b a s emanagement s y s t e m s . F o r e x a m p l e , i n t h e h a r d W a r e r e a l m ,i n c r e a s e s i n m i c r o p r o c e s s o r p e r f o r m a n c e , c o u p l e d W i t hi m p r o v e d memory a n a g e m e n t s y s t e m s , h a v e i m p r o v e d t h enumber f q u e r i e s t h a t a p a r t i c u l a r m i c r o p r o c e s s o r c a n p e rform n a g i v e n u n i t o f t i m e . F u r t h e r m o r e , t h e u s e o f m u l t i p l em i c r o p r o c e s s o r s a n d / o r m u l t i p l e n e t w o r k e d c o m p u t e r s h a sf u r t h e r i n c r e a s e d t h e c a p a c i t i es o f many d a t a b a s e management s y s t e m s .[ 0 0 0 6 ] From a s o f t W a r e s t a n d p o i n t , t h e u s e of e l a t i o n a ld a t a b a s e s , W h i c h o r g a n i z e i n f o r m a t i o n i n t o f o r m a l l y - d e ? n e dt a b l e s c o n s i s t i n g o f r o W s and c o l u m n s , and Which a r e t y p ic a l l y a c c e s s e d u s i n g a s t a n d a r d i z e d l a n g u a g e s u c h as S t r u ct u r e d Q u e r y L a n g u a g e ( S Q L ) , h a s s u b s t a n t i a l l y i m p r o v e dp r o c e s s i n g e f ? c i e n c y , a s W e l l a s s u b s t a n t i a l l y s i m p l i ? e d t h ec r e a t i o n , o r g a n i z a t i o n , and x t e n s i o n o f i n f o r m a t i o n W i th i n ad a t a b a s e . F u r t h e r m o r e , s i g n i ? c a n t d e v e l o p m e n t e f f o r t s h a v eb e e n d i r e c t e d t o W a r d q u e r y o p t i m i z a t i o n , W h e r e b y t h ee x e c u t i o n o f a r t i c u l a r s e a r c h e s , o r q u e r i e s , i s o p t i m i z e d i n a nautomated manner t o minimize t h e amount of resourcesr e q u i r e d to e x e c u t e e a c h q u e r y .[ 0 0 0 7 ] T h r o u g h t h e i n c o r p o r a t i o n o f a r i o u s h a r d W a r e a n ds o f t W a r e i m p r o v e m e n t s , many h i g h p e r f o r m a n c e d a t a b a s emanagement systems a r e a b l e t o handle hundreds o r event h o u s a n d s o f q u e r i e s e a c h s e c o n d , even on a t a b a s e s c o n t a i ni n g m i l l io n s o r b i l l i o n s o f e c o r d s . H o W e v e r , f u r t h e r i n c r e a s e si n information volume and Workload a r e i n e v i t a b l e , s o cont i n u e d advancements i n d a t a b a s e management s y s t e m s a r es t i l l r e q u i r e d .

    J a n . 1 0 , 2 0 1 3

    [ 0 0 0 8 ] One a r e a t h a t has been a f e r t i l e a r e a f o r academica n d c o r p o r a te r e s ea r c h i s t h a t o f i m p r o v i n g t h e d e s i g n s o f t h eq u e r y o p t i m i z e r s u t i l i z e d i n many c o n v e n t i o n a l d a t a b a s emanagement y s t e m s . The r i m a r y t a s k o f a q u e r y o p t i m i z e ri s t o choose t h e most e f ? c i e n t Wa y t o e x e c u t e each d a t a b a s eq u e r y , o r r e q u e s t , p a s s e d o t h e d a t a b a s e management s y s t e mby a u s e r . The u t p u t o f an p t i m i z a ti o n p r o c e s s i s t y p i c a l l yr e f e r r e d t o a s an e x e c u t i o n p l a n , a c c e s s p l a n , o r j u s t p l a n and s f r e q u e n t l y d e p i c t e d as a t r e e g r a p h . Such p l a nt y p i c a l l y i n c o r p o r a t e s ( o f t e n i n a p r o p r i e ta r y f o r m u n i q u e t oe a c h o p t i m i z e r / D B M S ) l o W - l e v e l i n f o r m a t i o n t e l l i n g t h ed a t a b a s e e n g i n e t h a t u l t i m a t e l y h a n d l e s a q u e r y p r e c i s e l yWhat s t e p s t o t a k e ( a n d i n What o r d e r ) t o e x e c u t e t h e q u e r y .A l s o t y p i c a l l y a s s o c i a t e d W i t h e a c h g e n e r a t e d p l a n s a n o p t im i z e r e s t i m a t e of oW o n g t W i l l t a k e t o r u n t h e q u e r y u s i n gt h a t p l a n .[ 0 0 0 9 ] A n p t i m i z e r s j o b i s o f t e n n e c e s s a r y a n d d i f ? c u l tb e c a u s e o f t h e enormous number i . e . , c o u n t a b l y i n ? n i t e number) o f p o s s i b l e q u e r y f o r m s t h a t c a n b e g e n e r a t e d i n ad a t a b a s e management s y s t e m , e . g . , due o f a c t o r s s u c h a s t h eu s e o f SQL u e r i e s W i t h a n y number f e l a t i o n a l t a b l e s madeup o f c o u n t l e s s d a t a columns o f v a r i o u s t y p e s , t h e t h e o r e t ic a l l y i n ? n i t e number f m e t h o d s o f a c c e s s i n g t h e a c t u a l d a t ar e c o r d s from e a c h t a b l e r e f e r e n c e d ( e . g . , u s i n g a n i n d e x , ah a s h a b l e , e t c . ) , t h e p o s s i b l e c o m b i n a t i o n s o f t h o s e m e t h o d so f a c c e s s among l l t h e t a b l e s r e f e r e n c e d , e t c . An p t i m i z e r so f t e n p e r m i t t e d t o r e W r i t e a q u e r y ( o r p o r t i o n o f t ) i n t o a n ye q u i v a l e n t f o r m , a n d s i n c e f o r a n y g i v e n q u e r y t h e r e a r et y p i c a l l y many e q u i v a l e n t f o r m s , a n o p t i m i z e r h a s a c o u n ta b l y i n ? n i t e u n i v e r s e o f e x t r e m e l y d i v e r s e p o s s i b l e s o l u t i o n s( p l a n s ) t o c o n s i d e r . On h e o t h e r h a n d , a n o p t i m i z e r i s o f t e nr e q u i r e d t o u s e minimal s y s t e m r e s o u r c e s g i v e n t h e d e s i r a b i li t y f o r h i g h t h r o u g h p u t . As u c h , a n o p t i m i z e r o f t e n h a s o n l ya l i m i t e d amount of i m e t o p a r e t h e s e a r c h s p a c e of o s s i b l ee x e c u t i o n p l a n s doWn t o a n o p t i m a l p l a n f o r a p a r t i c u l a rq u e r y .[ 0 0 1 0 ] Another a u t o m a t e d t o o l t h a t i s a p a r t o f man y a t ab a s e management s y s t e m s i s a d a t a b a s e m o n i t o r . I t i s used og a t h e r p e r f o r m a n c e s t a t i s t i c s r e l a t e d t o SQL q u e r i e s r u nW i t h i n t h e d a t a b a s e management s y s t e m . The d a t a c o l l e c t e dby t h e d a t a b a s e m o n i t o r i s t y p i c a l l y c o l l e c t e d i n a d a t a b a s e? l e i t s e l f Where t can be q u e r i e d by a t r a i n e d u s e r to h e l pi d e n t i f y a n d t u n e p e r f o r m a n c e p r o b l e m a r e a s . A a t a b a s emonitor y p i c a l l y t r a c k s t h e na m e of q u e r y , t h e na m e of h et a b le s a c c e s s e d b y t h e q u e r y , t h e i n d i c e s u s e d b y t h e q u e r y ( i fa n y ) , t h e j o i n p a r a m e t e r s o f t h e q u e r y , a n d o t h e r p e r t i n e n ti n f o r m a t i o n such a s t h e d u r a t i o n of time t h e query took t oc o m p l e t e . The e r f o r m a n c e s t a t i s t i c s c o l l e c t e d b y a d a t a b a s em o n i t o r a r e t y p i c a l l y l a r g e i n volume a n d r e q u i r e a knoWle d g e a b l e SQL d m i n i s t r a t o r t o i n t e r p r e t a n d u s e .[ 0 0 1 1 ] T y p i c a l q u e r y o p t i m i z e r s s t o r e i n f o r m a t i o n a b o u tp r e v i o u s l y e n c o u n t e r e d q u e r i e s a n d t h e a c c e s s p l a n s t h a t Werec r e a t e d f o r s u c h q u e r i e s . W hen p r e v i o u s q u e r y s o n c e a g a i ne n c o u n t e r e d , t h e s e o p t i m i z e r s u s e p r e v i o u s a c c e s s p l a ns t oa v o i d t h e t i m e and o s t o f r e - c r e a t i n g an a c c e s s p l a n r e g a r dl e s s o f hoW h e e a r l i e r a c c e s s p l a n p e r f o r m e d . T h u s , t h e c u rr e n t d e t e r m i n a t i o n and a n a l y s i s by t h e o p t i m i z e r t o r e - u s e ap l a n s i m p l y c o n s i d e r s W h e t h e r a s i m i l a r a c c e s s p l a n i s a v a i la b l e f o r u s e and d o e s n o t c o n s i d e r t h e p a s t p e r f o r m a n c es t a t i s t i c s of t h a t p l a n such a s t h o s e t h a t a r e c o l l e c t e d by ad a t a b a s e m o n i t o r . T h u s , t h e r e r e m a i n s t h e n e e d i n p r i o r d a t ab a s e e n v i r o n m e n t s f o r a s y s t e m t h a t p e r m i t s s e l e c t i n g o rmodifying a q u e r y a c c e s s p l a n based on e m p i r i c a l e v i d e n c e

  • 8/13/2019 Us 20130013586

    8/13

    US 013/0013586 A 1

    a b o u t t h e p e r f o r m a n c e s t a t i s t i c s o f p r e v i o u s l y e x e c u t e da c c e s s p l a n s t h a t were c o l l e c t e d by a d a t a b a s e m o n i to r .

    SUMMARY OFTHE INVENTION[ 0 0 1 2 ] Embodiments o f t h e p r e s e n t i n v e n t i o n r e l a t e t o ad a t a b a s e m o n i t o r t h a t t r a c k s p e r f o r m a n c e s t a t i s t i c s a n d i n f o rm a t i o n a b o u t t h e e x e c u t io n o f di f f e r e n t d a t a b a s e q u e r i e s anda q u e r y o p t i m i Z e r t h a t b e n e ? t s from t h e s e s t a t i s t i c s wheng e n e r a t i n g a n a c c e s s p l a n . I n p a r t i c u l a r , t h e q u e r y o p t i m i Z e r ,upon e c e i v i n g a d a t a b a s e q u e r y , s e a r c h e s a d a t a b a s e of e rf o r m a n c e s t a t i s t i c s f o r s i m i l a r d a t a b a s e q u e r i e s t h a t h a v e p r ev i o u s l y b e e n e x e c u t e d . As a r t o f d e t e r m i n i n g t h e b e s t a c c e s sp l a n f o r t h e c u r r e n t d a t a b a s e q u e r y , t h e q u e r y o p t i m i Z e r cons i d e r s t h e i n f o r m a t i o n r e t r i e v e d from t h e s t a t i s t i c s d a t a b a s e .I n h i s w a y , t h e a c c e s s p l a n t h a t s g e n e r a t e d c a n a u t o m a t i c a l l yb e t u n e d b a s e d on e m p i r i c a l e v i d e n c e o f p a s t p e r f o r m a n c e .[ 0 0 1 3 ] One a s p e c t o f t h e p r e s e n t i n v e n t i o n r e l a t e s to amethod o r g e n e r a t i n g a n a c c e s s p l a n . I n a c c o r d a n c e w it h t h i sm e t h o d , a p a r t i c u l a r s e t o f a s t p e r f o r m a n c e s t a t i s t i c s i s i d e nt i ? e d t h a t r e l a t e s t o a d a t a b a s e q u e r y . When h e q u e r y o p t imiZer e n e r a t e s an c c e s s p l a n f o r t h e c u r r e n t d a t a b a s e q u e r y ,i t s g e n e r a t i o n i s b a s e d a t l e a s t i n p a r t on h e p a r t i c u l a r s e t o fp a s t p e r f o r m a n c e s t a t i s t i c s .[ 0 0 1 4 ] A n o t h e r a s p e c t o f t h e p r e s e n t i n v e n t i o n r e l a t e s toa n o t h e r method f o r g e n e r a t i n g an a c c e s s p l a n i n which ar e s p e c t i v e s e t o f a s t p e r f o r m a n c e s t a t i s t i c s i s m a i n t a i n e d f o re a c h o f a p l u r a l i t y o f p r e v i o u s l y e x e c u t e d d a t a b a s e q u e r i e s .From t h e s e s t a t i s t i c s , a p a r t i c u l a r s e t o f p a s t p e r f o r m a n c es t a t i s t i c s i s i d en t i? e d c o r r e s p o n d i n g t o a p r e v i o u s l y e x e c u t e dd a t a b a s e query s i m i l a r t o a c u r r e n t d a t a b a s e query and t h ep e r f o r m a n c e o f a n a c c e s s p l a n i d e n t i ? e d w i t h i n t h e p a r t i c u l a rs e t o f ast p e r f o r m a n c e s t a t i s t i c s i s a n a l y Z e d . The u e r y o p t imiZer e n e r a t e s a c u r r e n t a c c e s s p l a n f o r t h e c u r r e n t d a t a b a s equery based a t l e a s t i n p a r t on t h e a c c e s s plan t h a t was anal y Z e d .[ 0 0 1 5 ] Y e t a n o t h e r a s p e c t o f h e p r e s e n t i n v e n t i o n e l a t e s toa n o t h e r method f o r g e n e r a t i n g an a c c e s s p l a n t h a t a l s oi n c l u d e s a r e s p e c t iv e s e t o f p a s t p e r f o r m a n c e s t a t i s t i c s b e i n gm a i n t a i n e d f o r e a c h o f a p l u r a l i t y o f p r e v i o u s l y e x e c u t e dd a t a b a s e q u e r i e s . A u r r e n t a c c e s s p l a n f o r a c u r r e n t d a t a b a s eq u e r y s i d e n t i ? e d a n d t h e n , from h e s t a t i s t i c s , a p a r t i c u l a r s e to f a s t p e r f o r m a n c e s t a t i s t i c s i s i d e n t i ? e d c o r r e s p o n d i n g t o ap r e v i o u s l y e x e c u t e d d a t a b a s e q u e r y t h a t u s e d t h e c u r r e n ta c c e s s p l a n . The p e r f o r m a n c e o f t h e p r e v i o u s l y e x e c u t e dd a t a b a s e q u e r y i s a n a l y Z e d and s e d t o d e t e r m i n e whether or e - u s e t h e c u r r e n t access p l a n .[ 0 0 1 6 ] S t i l l a n o t h e r a s p e c t o f t h e p r e s e n t i n v e n t i o n r e l a t e sto a method o r g e n e r a t i n g an c c e s s p l a n t h a t i n c l u d e s maint a i n i n g i n n o n - v o l a t i l e memory a r e s p e c t i v e s e t o f p a s t p e rf o r m a n c e s t a t i s t i c s f o r e a c h o f a p l u r a l i t y o f p r e v i o u s l ye x e c u t e d d a t a b a s e q u e r i e s . A e t o f h o s t v a r i a b l e s r e f e r e n c e si s i d e n t i ? e d w i t h i n t h o s e r e s p e c t i v e s e t s o f a s t p e r f o r m a n c es t a t i s t i c s t h a t r e l a t e t o d a t a s k e w p e r f o r m a n c e d e g r a d a t i o n .The u e r y o p t i m i Z e r f o r c e s r e - o p t i m i Z a t i o n t o g e n e r a t e a newa c c e s s p l a n f o r t h e c u r r e n t d a t a b a s e q u e r y if t h e c u r r e n t d a t abase query i n c l u d e s one o r more host v a r i a b l e s within t h ei d e n t i ? e d set o f h o s t v a r i a b l e s .

    BRIEF DESCRIPTIONOFTHE DRAWINGS[ 0 0 1 7 ] F I G . 1 i s a b l o c k diagram f a networked computers y s t e m i n c o r p o r a t i n g a d a t a b a s e management s y s t e m c o n s i st e n t w i t h t h e i n v e n t i o n .

    J a n . 1 0 , 2 0 1 3

    [ 0 0 1 8 ] F I G . 2 i s a b l o c k d i a g r a m i l l u s t r a t i n g t h e p r i n c i p a lcomponents and ?ow o f i n f o r m a t i o n t h e r e b e t w e e n i n t h ed a t a b a s e management s y s t e m o f F I G . 1 .[ 0 0 1 9 ] F I G . 3 i l l u s t r a t e s a ?owchart of an exemplarymethod o r a q u e r y o p t i m i Z e r t o u s e p a s t p e r f o r m a n c e s t a t i st i c s when e n e r a t i n g an a c c e s s p l a n .[ 0 0 2 0 ] F I G . 4 i l l u s t r a t e s a ?owchart of an exemplarymethod of l o c a t i n g a s i m i l a r SQL t a t e m e n t i n a d a t a b a s em o n i t o r s r e c o r d s t o use w h e n e n e r a t i n g an a c c e s s p l a n .[ 0 0 2 1 ] F I G . 5 i l l u s t r a t e s a ?owchart of an exemplarymethod o r d e t e r m i n i n g h o w o g e n e r a t e an c c e s s p l a n b a s e don h o w e l l a s i m i l a r a c c e s s p l a n performed i n t h e p a s t .[ 0 0 2 2 ] F I G . 6 i l l u s t r a t e s a ?owchart of an exemplarymethod o r d e t e r m i n i n g h o w o g e n e r a t e an c c e s s p l a n b a s e don a s t s t a t i s t i c s r e g a r d i n g d a t a s k e w .

    DETAILEDDESCRIPTION[ 0 0 2 3 ] As m e n t i o n e d a b o v e , t h e e m b o d i m e n t s d i s c u s s e dh e r e i n a f t e r u t i l i Z e a d a t a b a s e e n g i n e and o p t i m i Z e r f r a m ework t h a t s u p p o r t s e l e c t i n g a n a c c e s s p l a n b a s e d on p r e v io u s l y c o l l e c t e d p e r f o r m a n c e s t a t i s t i c s o f s i m i l a r a c c e s s p l a n st h a t h a v e p r e v i o u s l y e x e c u t e d . I n s t ea d o f m e r e l y r e l y i n g o ne s t i m a t e d c o s t s f o r t h e d i f f e r e n t a c c e s s p l a n s t r a t e g i e s , t h eq u e r y o p t i m i Z e r u s e s t h e e m p i r i c a l e v i d e n c e f r o m p r e v i o u sq u e r y e x e c u t i o n s w hen d e t e r m i n i n g how t o g e n e r a t e t h ea c c e s s p l a n . A p e c i ? c i m p l e m e n t a t i o n o f s u c h a d a t a b a s ee n g i n e a n d o p t i m i Z e r f r a m e w o r k c a p a b l e o f s u p p o r t i n g t h i sf u n c t i o n a l i t y i n a manner o n s i s t e n t with h e i n v e n t i o n w i l l bed i s c u s s e d i n g r e a t e r d e t a i l b e l o w . H o w e v e r , p r i o r t o a d i s c u ss i o n o f s u c h a s p e c i ? c i m p l e m e n t a t i o n , a b r i e f d i s c u s s i o n w i l lb e p r o v i d e d r e g a r d i n g a n e x e m p l a r y h a r d w a r e a n d s o f t w a r ee n v i r o n m e n t w i t h i n which u c h an p t i m i Z e r framework m a yr e s i d e .[ 0 0 2 4 ] T u r n i n g now o t h e D r a w i n g s , w h e r e i n i k e numbersd e n o t e l i k e p a r t s t h r o u g h o u t t h e s e v e r a l v i e w s , F I G . 1 i l l u st r a t e s an exemplary h ardware and s o f t w a r e e n v i r o n m e n t f o ran a p p a r a t u s 10 s u i t a b l e f o r implementing a d a t a b a s e mana g e m e n t s y s t e m t h a t c o n s i d er s p r e v i o u s p e r f o r m a n c e s t a t i st i c s when e l e c t i n g a c c e s s p l a n s c o n s i s t e n t w i t h t h e i n v e n ti o n .F o r t h e p u r p o s e s o f h e i n v e n t i o n , a p p a r a t u s 1 0 m a y e p r e s e n tp r a c t i c a l l y a n y t y p e o f c o m p u t e r , c o m p u t e r s y s t e m o r o t h e rp r o g r a m m a b l e l e c t r o n i c d e v i c e , i n c l u d i n g a c l i e n t c o m p u t e r ,a s e r v e r computer, a p o r t a b l e computer, a handheld computer,an embedded o n t r o l l e r , e t c . M o r e o v e r , a p p a r a t u s 1 0 m a y beimplemented s i n g one o r more networked computers, e . g . ,i n a c l u s t e r o r o t h e r d i s t r i b u t e d computing s y s t e m . A p p a r a t u s10 w i l l h e r e i n a f t e r a l s o be r e f e r r e d t o a s a computer,a l t h o u g h t s h o u l d b e a p p r e c i a t e d t h e t e r m a p p a r a t u s maya l s o i n c l u d e o t h e r s u i t a b l e programmable e l e c t r o n i c d e v i c e sc o n s i s t e n t w i t h t h e i n v e n t i o n .[ 0 0 2 5 ] Computer 1 0 t y p i c a l l y i n c l u d e s a t l e a s t o n e p r o c e ss o r 12 coupled o a m e m o r y 1 4 . P r o c e s s o r 12 may e p r e s e n tone r more r o c e s s o r s ( e . g . , m i c r o p r o c e s s o r s ) , and m e m o r y1 4 m a y e p r e s e n t t h e random c c e s s me mory (RAM) e v i c e sc o m p r i s i n g t h e main s t o r a g e o f computer 1 0 , a s w e l l a s a n ys u p p l e m e n t a l l e v e l s o f memory, e . g . , c a c h e m e m o r i e s , nonv o l a t i l e o r backup memories ( e . g . , programmable o r ? a s hm e m o r i e s ) , r e a d - o n l y m e m o r i e s , e t c . I n a d d i t i o n , memory 4m a y b e c o n s i d e r e d t o i n c l u d e memory s t o r a g e p h y s i c a l l yl o c a t e d e l s e w h e r e i n c o m p u t e r 1 0 , e . g . , a n y c a c h e memory na processor 1 2 , a s well a s any s t o r a g e c a p a c i t y used a s av i r t u a l memory, e . g . , a s stored on a mass storage device 16 oron n o t h e r computer o u p l e d to computer 1 0 v i a network 1 8( e . g . , a c l i e n t c o m p u t e r 2 0 ) .

  • 8/13/2019 Us 20130013586

    9/13

    US 013/0013586 A 1

    [ 0 0 2 6 ] Computer 1 0 a l s o t y p i c a l l y r e c e i v e s a number o fi n p u t s a n d o u t p u t s f o r c o m m u n i c a t i n g i n f o r m a t i o n e x t e rn a l l y . For i n t e r f a c e With a u s e r o r o p e r a t o r , computer 10t y p i c a l l y i n c l u d e s one o r more s e r i n p u t d e v i c e s 22 e . g . , ak e y b o a r d , a mouse, a t r a c k b a l l , a j o y s t i c k , a t o u c h p a d , a n d / o ra m i c r o p h o n e , among t h e r s ) and a d i s p l a y 24 ( e . g . , a CRTm o n i t o r , a n LCD i s p l a y p a n e l , a n d / o r a s p e a k e r , amongo t h e r s ) . O t h e r W i s e , u s e r i n p u t may b e r e c e i v e d v i a a n o t h e rc o m p u t e r ( e . g . , a c o m p u t e r 2 0 ) i n t e r f a c e d W i t h c o m p u t e r 1 0over netWork 1 8 , or i a a dedicated Workstation i n t e r f a c e ort h e l i k e .[ 0 0 2 7 ] F o r a d d i t i o n a l s t o r a g e , c o m p u t e r 1 0 may a l s oinclude one r more mass s t o r a g e devices 1 6 , e . g . , a ?oppy oro t h e r removable d i s k d r i v e , a hard d i s k d r i v e , a d i r e c t a c c e s ss t o r a g e d e v i c e (DASD), a n o p t i c a l d r i v e ( e . g . , a CD r i v e , aDVD r i v e , e t c . ) , a n d / r a t a p e d r i v e , among t h e r s . F u r t h e rmore, computer 10 may nclude an n t e r f a c e With one or moren e t Wo r k s 1 8 ( e . g . , a LAN, a WAN W i r e l e s s n e t W o r k , a n d / o rt h e I n t e r n e t , among t h e r s ) t o p e r m i t t h e c o m m u n i c a t i o n o fi n f o r m a t i o n W i t h o t h e r c o m p u t e r s c o u p l e d t o t h e n e t W o r k . I ts h o u l d b e a p p r e c i a t e d t h a t c o m p u t e r 1 0 t y p i c a l l y i n c l u d e ss u i t a b l e a n a l o g a n d / r i g i t a l i n t e r f a c e s betWeen r o c e s s o r 1 2a n d e a c h o f components 1 4 , 1 6 , 1 8 , 2 2 and 2 4 a s i s W e l lknoWn n t h e a r t .[ 0 0 2 8 ] Computer 1 0 o p e r a t e s u n d e r t h e c o n t r o l o f a n o p e ra t i n g s y s t e m 3 0 , and e x e c u t e s o r o t h e r W i s e r e l i e s upon a r io u s c o m p u t e r s o f t W a r e a p p l i c a t i o n s , c o m p o n e n t s , p r o g r a m s ,o b j e c t s , m o d u l e s , d a t a s t r u c t u r e s , e t c . ( e . g . , d a t a b a s e managem e n t s y s t e m 3 2 a n d d a t a b a s e 3 4 , among t h e r s ) . M o r e o v e r ,v a r i o u s a p p l i c a t i o n s , c o m p o n e n t s , p r o g r a m s , o b j e c t s , modu l e s , e t c . may l s o execute on one or more processors i na n o t h e r c o m p u t e r c o u p l e d t o c o m p u t e r 1 0 v i a a n e t W o r k 1 8 ,e . g . , i n a d i s t r i b u t e d o r c l i e n t - s e r v e r computing e n v i r o n m e n t ,W h e r e b y t h e p r o c e s si n g r e q u i r ed t o i m p l e m e n t t h e f u n c t i o n so f a computer program m a y e a l l o c a t e d to m u l t i p l e computers over a netWor k.[ 0 0 2 9 ] T u r n i n g b r i e ? y t o F I G . 2 , a n e x e m p l a r y i m p l e m e nt a t i o n o f d a t a b a s e management s y s t e m 3 2 i s s h o W n . Thep r i n c i p a l c o m p o n e n t s o f d a t a b a s e m a n a g e m e n t s y s t e m 3 2t h a t a r e r e l e v a n t t o query p t i m i z a t i o n a r e an SQL a r s e r 4 0 ,c o s t - b a s e d o p t i m i z e r 4 2 a n d d a t a b a s e e n g i n e 4 4 . SQL a r s e r40 r e c e i v e s from a u s e r a d a t a b a s e query 4 6 , Which i n t h ei l l u s t r a t e d e m b o d i m e n t , i s p r o v i d e d in t h e f o r m o f a n SQLs t a t e m e n t . SQL a r s e r 40 t h e n g e n e r a t e s a p a r s e d s t a t e m e n t4 8 t h e r e f r o m , Which i s p a s s e d t o o p t i m i z e r 4 2 f o r q u e r yo p t i m i z a t i o n . As a r e s u l t o f q u e r y o p t i m i z a t i o n , an e x e c u t i o no r a c c e s s p l a n 5 0 i s g e n e r a t e d , o f t e n u s i n g d a t a s u c h a s p l a tf o r m c a p a b i l i t i e s , q u e r y c o n t e n t i n f o r m a t i o n , e t c . , t h a t i ss t o r e d i n d a t a b a s e 3 4 . Once g e n e r a t e d , t h e e x e c u t i o n p l a n i sf o r W a r d e d o d a t a b a s e e n g i n e 4 4 f o r e x e c u t i o n o f h e d a t a b a s equery on t h e i n f o r m a t i o n i n d a t a b a s e 3 4 . The r e s u l t of t h ee x e c u t i o n o f t h e d a t a b a s e q u e r y i s t y p i c a l l y s t o r e d i n a r e s u l ts e t , a s r e p r e s e n t e d a t b l o c k 5 2 .[ 0 0 3 0 ] W h i l e t h e d a t a b a s e e n g i n e 4 4 e x e c u t e s t h e q u e r y 4 6 ,a d a t a b a s e m o n i t o r 6 0 t r a c k s p e r f o r m a n c e o f t h e e x e c u t i o nand c o l l e c t s s t a t i s t i c s and o t h e r i n f o r m a t i o n a b o u t h o W t h ep l a n 5 0 i s p e r f o r m i n g . The t a t i s t i c s a n d i n f o r m a t i o n f o r e a c hquery 46 a r e s t o r e d i n a monitor d a t a b a s e 6 2 . The d a t a b a s em o n i t o r 6 2 i s a d v a n t a g e o u s l y a r e l a t i o n a l d a t a b a s e t h a t p e rm i t s e a s y s e a r c h i n g a n d r e t r i e v a l o f a t a .[ 0 0 3 1 ] O t h e r c o m p o n e n t s may e i n c o r p o r a t e d i n t o s y s t e m3 2 , as m a y t h e r s u i t a b l e d a t a b a s e management r c h i t e c t u r e s .O t h e r d a t a b a s e p r o g r a m m i n g a n d o r g a n i z a t i o n a l a r c h i t e c

    J a n . 1 0 , 2 0 1 3

    t u r e s m a y l s o be used c o n s i s t e n t W i t h t h e i n v e n t i o n . Theref o r e , t h e i n v e n t i o n i s n o t l i m i t e d t o t h e p a r t i c u l a r implement a t i o n d i s c u s s e d h e r e i n .[ 0 0 3 2 ] I n g e n e r a l , t h e r o u t i n es e x e c u t e d t o i m p l e m e n t t h eembodiments o f t h e i n v e n t i o n , W h e t h e r i m p l e m e n t e d a s p a r to f a n o p e r a t i n g s y s t e m o r a s p e c i ? c a p p l i c a t i o n , c o m p o n e n t ,program, b j e c t , module r sequence of n s t r u c t i o n s , o r evena s u b s e t t h e r e o f , W i l l be r e f e r r e d to h e r e i n a s computerp r o g r a m c o d e , o r s i m p l y p r o g r a m c o d e . P r o g r a m c o d et y p i c a l l y comprises one r more n s t r u c t i o n s t h a t a r e r e s i d e ntat v a r i o u s t i m e s i n v a r i o u s memory and s t o r a g e d e v i c e s i n ac o m p u t e r , and h a t , W h e n e a d and e x e c u t e d by one r morep r o c e s s o r s i n a c o m p u t e r , c a u s e t h a t computer o perform h es t e p s n e c e s s a r y t o e x e c u t e s t e p s o r e l e m e n t s embodying t h ev a r i o u s a s p ec t s o f t h e i n v e n t i o n . M o r e o v e r , W h i le t h e i n v e nt i o n h a s and h e r e i n a f t e r W i l l be d e s c r i b e d i n t h e c o n t e x t o ff u l l y f u n c t i o n i n g c o m p u t e r s a n d c o m p u t e r s y s t e m s , t h o s es ki l l e d i n t h e a r t W i l l a p p r e c i a t e t h a t t h e v a r i o u s embodimentsof h e i n v e n t i o n a r e c a p a b l e of e i n g d i s t r i b u t e d a s a programp r o d u c t i n a v a r i e t y o f f o r m s , a n d t h a t t h e i n v e n t i o n a p p l i e se q u a l l y r e g a r d l e s s o f t h e p a r t i c u l a r t y p e o f s i g n a l b e a r i n gmedia s e d t o a c t u a l l y c a r r y o u t t h e d i s t r i b u t i o n . Examples fs i g n a l b e a r i n g media n c l u d e b u t a r e n o t l i m i t e d to r e c o r d a b l et y p e media u c h a s v o l a t i l e and o n - v o l a t i l e me mory e v i c e s ,? o p p y a n d o t h e r r e m o v a b l e d i s k s , h a r d d i s k d r i v e s , m a g n e t i ct a p e , o p t i c a l d i s k s ( e . g . , C D - R O M s , D V D s , e t c . ) , a m o n go t h e r s , and t r a n s m i s s i o n t y p e media s u c h a s d i g i t a l and a n al o g c o m m u n i c a t i o n l i n k s .[ 0 0 3 3 ] I n a d d i t i o n , v a r i o u s p r o g r a m c o d e d e s c r i b e d h e r ei n a f t e r may e i d e n t i ? e d b a s e d upon t h e a p p l i c a t i o n W i t h i nWhich t i s i m p l e m e n t e d i n a s p e c i ? c embodiment o f t h ei n v e n t i o n . H o W e v e r , t s h o u l d b e a p p r e c i a t e d h a t a n y p a r t i c ul a r program n o m e n c l a t u r e t h a t f o l l o W s i s u s e d m e r e l y f o rc o n v e n i e n c e , and h u s t h e i n v e n t i o n s h o u l d n o t be l i m i t e d t ou s e s o l e l y i n a n y s p e c i ? c a p p l i c a t i o n i d e n t i ? e d a n d / o ri m p l i e d b y s u c h n o m e n c l a t u r e . F u r t h e r m o r e , g i v e n t h e t y p ic a l l y e n d l e s s number o f manners i n Which computer p r og r a m s may e o r g a n i z e d i n t o r o u t i n e s , p r o c e d u r e s , m e t h o d s ,m o d u l e s , o b j e c t s , and h e l i k e , a s W e l l a s t h e v a r i o u s mannersi n Which program u n c t i o n a l i t y may e a l l o c a t e d among a r io u s s o f t W ar e l a y e r s t h a t a r e r e s i d e n t W i t h i n a t y p i c a l computere . g . , o p e r a t i n g s y s t e m s , l i b r a r i e s , A P I s , a p p l i c a t i o n s ,a p p l e t s , e t c . ) , i t s h o u l d b e a p p r e c i a t e d h a t t h e i n v e n t i o n s n o tl i m i t e d t o t h e s p e c i ? c o r g a n i z a t i o n a n d a l l o c a t i o n o f r o g r a mf u n c t i o n a l i t y d e s c r i b e d h e r e i n .[ 0 0 3 4 ] Those k i l l e d i n t h e a r t W i l l r e c o g n i z e t h a t t h e exemp l a r y e n v i r o n m e n t i l l u s t r a t e d i n FIGS. 1 and i s n o t i n t e n d e dto l i m i t t h e p r e s e n t i n v e n t i o n . I n d e e d , t h o s e s k i l l e d i n t h e a r tW i l l r e c o g n i z e t h a t o t h e r a l t e r n a t i v e h a r d W a r e a n d / r s o f t W a r ee n v i r o n m e n t s m a y e u s e d W i t h o u t d e p a r t i n g from h e s c o p eo f t h e i n v e n t i o n .[ 0 0 3 5 ] Q u e r y o p t i m i z e r s h a v e a d d e d g r e a t b e n e ? t s t o a u t om a t i c o p e r a t i o n o f d a t a b a s e management s y s t e m s . T h e s eo p t i m i z e r s h a v e a l l o W e d d if f e r e n t a c c e s s p l a n s t r a t e g i e s t o b eq u i c k l y e x p l o r e d s o t h a t an p t i m a l s t r a t e g y c a n b e i d e n t i ? e dand s e l e c t e d t o p e r f o r m a n SQL t a t e m e n t . I n a d d i t i o n , t h e r ea r e a number of a t a b a s e monitoring o o l s a v a i l a b l e to c o l l e c ts t a t i s t i c s a b o u t q u e r i e s a s t h e y e x e c u t e . H o W e v e r , t h e s e s t at i s t i c s h a v e t y p i c a l l y b e e n u s e f u l o n l y t o s k i l l e d a d m i n i s t r at o r s W h o can n t e r p r e t t h e s t a t i s t i c s and s e them o h e l p t u n ea d a t a b a s e . Embodiments o f t h e p r e s e n t i n v e n t i o n contemp l a t e u s i n g t h e d a t a c o l l e c t e d b y d a t a b a s e m o n i t o r i n g t o o l s t oa u t o m a t i c a l l y a l l o W a d a t a b a s e o t u n e i t s e l f by e r m i t t i n g t h eq u e r y o p t i m i z e r o u t i l i z e t h e p e r f o r m a n c e s t a t i s t i c s c o l l e c t e d

  • 8/13/2019 Us 20130013586

    10/13

    US 013/0013586 A 1

    When e n e r a t i n g a q u e r y a c c e s s p l a n . T y p i c a l q u e r y o p t i m i Ze r s h a v e r e l a t i v e l y r o b u s t p e r f o r m a n c e a n d s u c c e s s f u l l yc h o o s e a n o p t i m a l a c c e s s p l a n t h e m a j o r i t y o f t h e t i m e ; hoWe v e r , i n c e r t a i n i n s t a nc e s , t h e q u e r y o p t i m i Z e r m a y a v e d i f? c u l t y i n s e le c t i n g t h e b e s t a c c e s s p l a n . F o r e x a m p l e , t h emore complex h e WHERE l a u s e t h a t ? l t e r s t h e s e l e c t i o n o froWs o f a t a b l e , t h e more i ? i c u l t y t h e q u e r y o p t i m i Z e r h a s i ns e l e c t i n g t h e be s t a c c e s s p l a n . A l s o , When u l t i p l e ?le s ( o rt a b l e s ) a r e i n v o l v e d i n a q u e r y , an o p t i m i Z e r m a y have d i ? ic u l t y i n s e l e c t i n g a n e ? i c i e n t a c c e s s p l a n . By u s i n g p a s tperformance t a t i s t i c s a b o u t hoW a s i m i l a r a c c e s s p l a n a c t ua l l y p e r f o r m e d , t h e q u e r y o p t i m i Z e r may e p r e v e n t e d f r o ms e l e c t i n g a p o o r p e r f o r m i n g a c c e s s p l a n t h a t o t h e r W i s ea p p e a r s t o b e t h e o p t i m a l p l a n .[ 0 0 3 6 ] The y p e o f d a t a t h a t can e c o l l e c t e d by a d a t a b a s em o n i t o r i s l a r g e a n d v a r i e d . The e x e m p l a r y e m b o d i m e n t sd e s c r i b e d h e r e i n p r o v i d e s p e c i ? c e x a m p l e s o f p e r f o r m a n c es t a t i s t i c s t h a t may be used t o a f f e c t Which a c c e s s p l a n ano p t i m i Z e r s e l e c t s . H o W e v e r , t h e p r e s e n t i n v e n t i o n a l s o c o nt e m p l a t e s u s i n g o t h e r s p e c i ? c p e r f o r m a n c e s t a t i s t i c s t o a s s i s tt h e q u e r y o p t i m i Z e r . Commonly s e d p e r f o r m a n c e s t a t i s t i c si n c l u d e ? l e s i Z e , memory i Z e , p r o c e s s o r s p e e d , number o fp r o c e s s o r s a v a i l a b l e , t h e SQL s t a t e m e n t ( W i t h p a r a m e t e r sr e p l a c e d ) , t y p e o f SQL p e r a t i o n , n u m b e r o f r o W u p d a t e d ,i n s e r t e d , o r d e l e t e d , number f o W s f e t c h e d , e l a p s e d t i m e f o rt h i s o p e r a t i o n , a c c e s s p l a n r e b u i l d c o d e , t a b l e n a m e , j o i n? e l d s , e s t i m a t e d c o m p l e t i o n t i m e , e s t i m a t e I / O o p e r a t i o n s ,number o f roWs i n t h e t a b l e , i n d e x name, h a s h u s e d , h o s tv a r i a b l e s , j o i n p o s i t i o n , j o i n m e t h o d , o i n t y p e , e t c .[ 0 0 3 7 ] I n g e n e r a l , FIG. 3 i l l u s t r a t e s a ?owchart of n exemp l a r y e m b o d i m e n t o f t h e p r e s e n t i n v e n t i o n . I n s t e p 3 0 2 , SQLs t a t e m e n t s a r e e x e c u t e d a n d d u r i n g e x e c u t i o n , p e r f o r m a n c es t a t i s t i c s r e l a t i n g to e a c h SQL t a t e m e n t a r e t r a c k e d andr e c o r d e d . The performance tatisti c s a r e maintained n a mann e r t h a t s a c c e s s i b l e by h e q u e r y o p t i m i Z e r . When neW SQLs t a t e m e n t i s r e c e i v e d i n s t e p 3 0 4 , t h e q u e r y o p t i m i Z e r b e g i n st o g e n e r a t e a n a c c e s s p l a n , i n s t e p 3 0 6 . As a r t o f d e v e lo p i n gt h e a c c e s s p l a n , t h e q u e r y o p t i m i Z e r s e a r c h e s t h e p e r f o r m a n c es t a t i s t i c s , i n s t e p 3 0 8 , t o l o c a t e a t l e a s t one s i m i l a r SQLs t a t e m e n t t h a t Was p e r f o r m e d i n t h e p a s t . I n s t e p 3 1 0 , t h eperformance statisti c s of t h i s s t a t e m e n t , o r more than ones t a t e m e n t, a r e t h e n u s e d by t h e q u e r y o p t i m i Z e r When e v e lo p i n g t h e a c c e s s p l a n . The p t i m i Z e r m a y s e h i s i n f o r m a t i o nto f o r c e c e r t a i n r e s t r i c t i o n s When e v e l o p i n g an c c e s s p l a n o rmay se t h i s information t o s e l e c t betWeen d i f f e r e n t a c c e s sp l a n s t h a t a r e a v a i l a b l e f o r t h e p a r t i c u l a r SQL s t a t e m e n t .[ 0 0 3 8 ] F I G . 4 i l l u s t r a t e s one exemplary s e of e r t a i n p e rformance t a t i s t i c s of h e d a t a b a s e monitor o a s s i s t t h e q u e r yo p t i m i Z e r i n s e l e c t i n g a n a c c e s s p l a n . A u e r y o p t i m i Z e rt y p i c a l l y m a i n t a i n s a l i s t o f a c c e s s p l a n s t h a t h a v e been r ev i o u s l y e x e c u t e d . T h u s , When a n SQL t a t e m e n t i s encount e r e d , t h e q u e r y o p t i m i Z e r s e a r c h e s t s c a c h e o f l a n s t o d e t e rmine if i t needs t o b u i l d an a c c e s s p l a n from s c r a t c h o rWhether t can r e - u s e an a c c e s s p l a n i t h a s p r e v i o u s l y b u i l t .HoWever, an c c e s s p l a n f o r a p a r t i c u l a r SQL t a t e m e n t m a yn o t be found i n t h e cache if t h e cache a c t s a s a FIFO u f f e rW i t h l i m i t e d s i Z e o r i f t h e c a c h e i s i n v o l a t i l e memory t h a te x i s t s o n l y d u r i n g t h e c u r r e n t s e s s i o n o f t h e q u e r y o p t i m i Z e r .S i m i l a r l y , d u r i n g d y n a m i c SQL p e r a t i o n , t h e q u e r y a c c e s sp l a n s a r e n o t s a v e d a s t h e y a r e e x e c u t e d . HoWever, t h e d a t ab a s e monitor s t o r e s a n o n - v o l a t i l e r e c o r d of p r e v i o u s l ye x e c u t e d a c c e s s p l a n s a n d , t h e r e f o r e , p r o v i d e s a n a d d i t i o n a ls o u r c e o f i n f o r m a t i o n f o r t h e q u e r y o p t i m i Z e r .

    J a n . 1 0 , 2 0 1 3

    [ 0 0 3 9 ] I n s t e p 4 0 2 , t h e q u e r y o p t i m i Ze r i d e n t i ? e s t h e SQLs t a t e m e n t a n d d e t e r m i n e s , i n s t e p 4 0 4 , W h e t h e r a n e x i s t i n ga c c e s s p l a n , c u r r e n t l y m a i n t a i n e d b y t h e q u e r y o p t i m i Z e r , i sa v a i la b l e f o r t h e q u e r y . I f s o , t h e n t h a t a c c e s s p l a n i s u s e d , i ns t e p 4 0 6 , t o p e r f o r m t h e q u e r y .[ 0 0 4 0 ] I f t h e q u e r y o p t i m i Z e r c a n n o t l o c a t e a p r e v i o u s l yi m p l e m e n t e d q u e r y a c c e s s p l a n , t h e n t s e a r c h e s , i n s t e p 4 0 8 ,t h e r e c o r d s of h e d a t a b a s e monitor o r a s i m i l a r q u e r y o r SQLs t a t e m e n t . One f o r d i n a r y s k i l l W i l l r e c o g n i Z e t h a t t h e r e a r ea v a r i e t y o f Ways o measure s i m i l a r i t y betWeen u e r i e s . Theq u e r i e s may b e c o m p a r e d on h e i r SQL s y n t a x , t h e i r JOINv a r i a b l e s , t h e i r WHERE l a u s e s , t h e i r h o s t v a r i a b l e s , a n do t h e r c h a r a c t e r i s t i c s . I f t h e p r e s e n t SQL u e r y i s s i m i l a r t o as t o r e d q u e r y , t h e n t h e q u e r y o p t i m i Z e r r e t r i e v e s o t h e r p e r f o rmance s t a t i s t i c s a b o u t t h e s t o r e d query from t h e d a t a b a s em o n i t o r r e c o r d s , i n s t e p 4 1 0 .[ 0 0 4 1 ] I n s t e p 4 1 2 , t h e p e r f o r m a n c e s t a t i s t i c s o f t h e s t o r e dq u e r y a r e o p t i o n a l l y c h e c k e d t o v e r i f y t h a t i t p e r f o r m e d t h equery s e s t i m a t e d o r With h e e s t i m a t e d number of /O perat i o n s . A l t e r n a t i v e l y , t h e p e r f o r m a n c e s t a t i s t i c s c a n b e u s e d t odetermine t h e number of roWs f e t c h e d a s compared t o t h enumber of roWs u p d a t e d . T h i s s t a t i s t i c m a y be used o d e t e rmine i f t h e SELECT c l a u s e i s s u ? i c i e n t l y ? l t e r i n g r e c o r d sa c t e d on by h e WHERE l a u s e . The u r p o s e o f t h e d e t e r m in a t i o n i n s t e p 4 1 2 i s t o i d e n t i f y W h e t h e r t h e a c c e s s p l a nt r a c k e d W i t h i n t h e d a t a b a s e m o n i t o r i s one t h a t performeds u f ? c i e n t l y W e l l s o a s t o recommend t t o t h e q u e r y o p t i m i Z e r .[ 0 0 4 2 ] From t h e i n f o r m a t i o n i n t h e d a t a b a s e m o n i t o rr e c o r d s , t h e q u e r y o p t i m i Z e r c a n b e f o r c e d , i n s t ep 4 1 4 , t o u s ec e r t a i n i m p l e m e n t a t i o n s t o g e n e r a t e a n a c c e s s p l a n ( e . g . , j o i no r d e r s , i n d e x e s , e t c . ) instead o f g e n e r a t i n g t h e e n t i r e a c c e s sp l a n f r o m s c r a t c h . I n s t e p 4 1 6 , t h e n , t h i s a c c e s s p l a n i se x e c u t e d t o i m p l e m e n t t h e q u e r y .[ 0 0 4 3 ] F I G . 5 i l l u s t r a t e s a ? o w c h a r t o f a n o t h e r e x e m p l a r yu s e o f performance s t a t i s t i c s by a q u e r y o p t i m i Z e r in a c c o rd a n c e W i t h t h e p r i n c i p l e s o f h e p r e s e n t i n v e n t i o n . I n t e p 5 0 2 ,t h e q u e r y o p t i m i Z e r r e c e i v e s a n SQL t a t e m e n t a n d i d e n t i ? e s ,i n s t e p 5 0 4 , an a c c e s s p l a n t h a t had r e v i o u s l y been s e d t oi m p l e m e n t t h i s SQL s t a t e m e nt . I n s t e p 5 0 6 , t h e q u e r y o p t imiZer can h e n s e a r c h f o r a r e c o r d i n t h e d a t a b a s e monitor ofa p r e v i o u s SQL s t a t e m e n t t h a t a l s o u s e d t h i s a c c e s s p l a n .From h i s r e c o r d , a d e t e r m i n a t i o n i s m a d e , in s t e p 5 0 8 , a b o u thoW W e l l t h e a c c e s s p l a n p e r f o r m e d t h e SQL s t a t e m e n t . F o re x a m p l e , t h e e s t i m a t e d I / O o p e r a t i o n s c a n b e c o m p a r e da g a i n s t t h e a c t u a l I / O o p e r a t i o n s o r t h e e s t i m a t e d c o m p l e t i o nt i m e c a n be compared o t h e a c t u a l c o m p l e t i o n t i m e . I n a d d it i o n , o t h e r p e r f o r m a n c e c h a r a c t e r i s t i c s c a n b e compared t oone a n o t h e r to determine if t h e a c c e s s p l a n performed a si n t e n d e d . I f t h e p e r f o r m a n c e o f t h e a c c e s s p l a n Was beloWa c c e p t a b l e l e v e l s , t h e n t h e q u e r y o p t i m i Z e r f o r c e s r e - o p t i m iZ a t i o n o f t h e a c c e s s p l a n f o r t h i s SQL s t a t e m e n t , i n s t e p 5 1 0 .I f t h e a c c e s s p l a n d i d p e r f o r m a d e q u a t e l y , t h e n t h e q u e r yo p t i m i Z e r may i m p l e m e n t t h e q u e r y p l a n a s i t s t a n d s , i n s t e p5 1 2 .[ 0 0 4 4 ] f r e - o p t i m i Z a t i o n s s e l e c t e d , t h e n t h e e s t i m a t e d r u nt i m e f o r t h e o r i g i n a l a c c e s s p l a n may b e i n c r e a s e d , in s t e p5 1 4 , t o r e ? e c t t h e d i s c o v e r y t h a t t h e p r e v i o u s e s t i m a te d r u nt i m e proved t o be t o o s h o r t . I n t h i s W a y , t h e o r i g i n a l a c c e s sp l a n becomes e s s a t t r a c t i v e t o t h e q u e r y o p t i m i Z e r When h eq u e r y o p t i m i Z e r i s s e l e c t i n g from among d i f f e r e n t a c c e s sp l a n s f o r a p a r t i c u l a r q u e r y i n t h e f u t u r e . Even f t h e o r i g i n a la c c e s s p l a n i s s e l e c t e d , t h e q u e r y o p t i m i Z e r may t i l i Z e t h e

  • 8/13/2019 Us 20130013586

    11/13

    US 013/0013586 A 1

    h i s t o r i c a l r e c o r d s o f t h e d a t a b a s e m o n i t o r t o l e a r n t h e c l o s e s te s t i m a t e d r u n t im e f o r a p a r t i c u l a r a c c e s s p l a n and d j u s t thema c c o r d i n g l y .[ 0 0 4 5 ] A n o t h e r a r e a w h e r e e m p i r i c a l p e r f o r m a n c e s t a t i st i c s c a n b e u s e d by q u e r y o p t i m i Z e r t o i m p r o v e g e n e r a t i o n o fan a c c e s s p l a n i s r e l a t e d t o d a t a s k e w . The h y s i c a l a r r a n g ement f d a t a on i f f e r e n t d e v i c e s a f f e c t s t h e performance ofd a t a b a s e o p e r a t i o n s . F o r e x a m p l e , i f a p a r t i c u l a r q u e r y e s u l t si n a c c e s s i n g d a t a t h a t i s randomly s c a t t e r e d o v e r a v a r i e t y o fd i f f e r e n t d e v i c e s , t h e n a l a r g e p o r t i o n o f t h e I / O o p e r a t i o n smay ccur i n p a r a l l e l . I f t h e d a t a t o be a c c e s s e d i s concent r a t e d on one r j u s t a few d e v i c e s , then / O o p e r a t i o n s occurm a i n l y s e r i a l l y a n d p e r f o r m a n c e s d e g r a d e d . O t h e r a t a s k e ws i t u a t i o n s may x i s t where n e p a r t i c u l a r d e v i c e i s e s p e c i a l l yslow such t h a t any q u e r y p l a n t h a t a c c e s s t h a t d e v i c e r u n sm uc h l o w e r e . g . , 2 5 t o 1 0 0 t i m e s ) s l o w e r t h a n a v e r a g e q u e r yp l a n s. I n l a r g e d a t a w a r e h o u s e s , a d e v i c e m a y e a p h y s i c a ld e v i c e o r a l o g i c a l p a r t i t i o n . F o r e x a m p l e , a d e v i c e m a y bep a r t i t i o n t h a t i s s t r i p e d a c r o s s m u l t i p l e p h y s i c a l d r i v e s . D a t askew r e f e r s t o t h e g e n e r a l c o n d i ti o n i n which t h e p h y s i c a lmanner n which h e d a t a i s s t o r e d a d v e r s e l y a f f e c t s t h e p e rf o r m a n c e o f p e r f o r m i n g c e r t a i n I / O o p e r a t i o n s .[ 0 0 4 6 ] The ? o w c h a r t o f F I G . 6 i l l u s t r a t e s o n e e x e m p l a r ymethod f o r a q u e r y o p t i m i Z e r to c o n s i d e r d a t a skew w h e ns e l e c t i n g a n a c c e s s p l a n f o r i m p l e m e n t i n g a n SQL t a t e m e n t .I n s t e p 6 0 2 , t h e d a t a b a s e m o n i t o r s q u e r i e d o i de n t i f y w h i c hh o s t v a r i a b l e s a r e i n v o l v e d i n query p l a n s t h a t e x e c u t e d xt i m e s s l o w e r than t s e s t i m a t e d run time (where x may e av a r i e t y o f numbers s u c h a s , b u t n o t l i m i t e d t o , b e t w e e n2 5 - 1 0 0 ) . These h o s t v a r i a b l e s a r e i d e n t i ? e d a s h o s t v a r i a b l et h a t i n v o l v e d a t a s k e w . I n s t e p 6 0 4 , t h e q u e r y o p t i m i Z e rr e c e i v e s an SQL t a t e m e n t and e g i n s g e n e r a t i o n o f an c c e s sp l a n i n s t e p 6 0 6 . As a r t o f t h e g e n e r a t i o n o f t h e a c c e s s p l a n ,t h e q u e r y o p t i m i Z e r d e t er m i n e s , i n s t e p 6 0 8 , i f t h e c u r r e n tSQL tatement i n c l u d e s one r more h o t v a r i a b l e s t h a t havebeen i d e n t i ? e d a s i n v o l v i n g d a t a s k e w . I f s o , t h e n t h e q u e r yo p t i m i Z e r can o r c e a r e - o p t i m i Z a t i o n i n s t e p 610 t o e n s u r e anew a c c e s s p l a n i s g e n e r a t e d from s c r a t c h . O t h e r w i s e , a c u rr e n t a c c e s s p l a n can be e x e c u t e d , i n s t e p 6 1 2 , w i t h o u t r eo p t i m i Z a t i o n , i f a v a i l a b l e .[ 0 0 4 7 ] The method d e s c r i b e d w i t h r e l a t i o n to F I G . 6 i sp a r t i c u l a r l y u s e f u l when h e d a t a b a s e management s y s t e m i so p e r a t i n g i n a mode known s r e u s a b l e open a t a p a t h (ODP)mode. The ODP s a d a t a s t r u c t u r e within an a c c e s s plan h a td e ? n e s a n a c t i v e p a t h t h r o u g h which a t a i s r e a d . I n r e u s a b l eODP ode, t h e ODP s k e p t open e v e n w hen h e SQL u e r yt h a t r e q u e s t e d t h e p a t h i s c l o s e d . T h i s s p e e d s u p d a t a a c c e s st h e n e x t t i m e t h e p a t h i s n e e d e d . R e u s a b l e ODP modei m p r o v e s p e r f o r m a n c e b u t i s p a r t i c u l a r l y s u s c e p t i b l e t o p e rformance d e g r a d a t i o n due t o d a t a s k e w . T h u s , i f a q u e r y i nr e u s a b l e ODP ode r e f e r e n c e s a s e t of o s t v a r i a b l e s t h a th a v e b e e n i d e n t i ? e d a s i n v o l v i n g d at a s k e w , i t i s p a r t i c u l a r l ya d v a n t a g e o u s t o e x i t t h e r e u s a b l e ODP ode and f o r c e ar e - o p t i m i Z a t i o n o f h e q u e r y . I f h i s a t t e m p t t r e - o p t i m i Z a t i o nd o e s n o t r e s u l t in any i m p r o v e m e n t s , t h e n t h i s s e t o f h o s tv a r i a b l e s can be marked a s e s p e c i a l l y harmful s o t h a t i n t h ef u t u r e no time o r e f f o r t i s wasted o f o r c e r e - o p t i m i Z a t i o n ofq u e r i e s t h a t r e f e r e n c e t h i s s e t o f h o s t v a r i a b l e s .[ 0 0 4 8 ] A n o t h e r p e r f o r m a n c e s t a t i s t i c t h a t i s p e r i p h e r a l l yr e l a t e d t o d a t a skew i n v o l v e s i n f o r m a t i o n a b o u t w h e n t a b l eo r ? l e was e - o r g a n i Z e d . R e - o r g a n i Z a t i o n o f a ? l e c h a n g e s i t sp h y s i c a l l a y o u t on t h e d i f f e r e n t s t o r a g e d e v i c e s on which ad a t a b a s e i s i m p l e m e n t e d a n d i m p l i c a t e s w h a t i n d e x mayi m p r o v e ? l e a c c e s s p e r f o r m a n c e . T h u s , q u e r y a c c e s s p l a n s

    J a n . 1 0 , 2 0 1 3

    t h a t executed e f o r e a ? l e was e - o r g a n i Z e d may, o r may o t ,b e t h e b e s t a c c e s s p l a n o implement n SQL t a t e m e n t . T h u s ,t h e q u e r y o p t i m i Z e r , when s t i m a t i n g I / O o p e r a t i o n s o r whene v a l u a t i n g e s t i m a t e d run t i m e s , i n o r d e r t o s e l e c t an a c c e s sp l a n , m a y a l s o c o n s i d e r whether a t a b le o r ? l e h a s beenr e - o r g a n i Z e d when d e t e r m i n i n g how much e i g h t t o a s s i g nt h e d i f f e r e n t p e r f o r m a n c e s t a t i s t i c s .[ 0 0 4 9 ] A c c o r d i n g l y , a s y s t e m a n d method h a s b e e nd e s c r i b e d t h a t p e r m i t s a q u e r y o p t i m i Z e r t o a u t o m a t i c a l l yc o n s i d e r e m p i r i c a l p e r f o r m a n c e s t a t i s t i c s when s e le c t i n g a na c c e s s p l a n f o r an SQL t a t e m e n t . V a r i o u s modi?cations m a yb e made t o t h e i l l u s t r a t e d embodiments w i t h o u t d e p a r t i n gf r o m t h e s p i r i t a n d s c o p e o f t h e i n v e n t i o n . T h e r e f o r e , t h ei n v e n t i o n l i e s i n t h e c l a i m s h e r e i n a f t e r a p p e n d e d .What s c l a i m e d i s :1 . A ethod f o r g e n e r a t i n g an a c c e s s p l a n , t h e method

    c o m p r i s i n g t h e s t e p s o f :m a i n t a i n i n g i n n o n - v o l a t i l e memory r e s p e c t i v e s e t o f a s t

    p e r f o r m a n c e s t a t i s t i c s f o r e a c h o f a p l u r a l i t y o f p r e v io u s l y e x e c u t e d d a t a b a s e q u e r i e s , w h e r e i n t h e s e t s o f a s tp e r f o r m a n c e s t a t i s t i c s a r e a s s o c i a t e d w i t h r e s p e c t i v ed a t a b a s e q u e r i e s , a n d w h e r e i n e a c h s e t o f p a s t p e r f o rmance t a t i s t i c s includes one or more f number f rowsu p d a t e d , i n s e r t e d , o r d e l e t e d by a r e s p e c t i v e d a t a b a s eq u e r y , number f rows f e t c h e d by a r e s p e c t i v e d a t a b a s eq u e r y , e l a p s e d t i m e f o r a r e s p e c t i v e d a t a b a s e q u e r y , e s t imated o m p l e t i o n t i m e f o r a r e s p e c t iv e d a t a b a s e q u e r y ,e s t i m a te d I / O o p e r a t i o n s f o r a r e s p e c t i v e d a t a b a s e q u e r y ,a c t u a l I / O o p e r a t i o n s f o r a r e s p e c t i v e d a t a b a s e q u e r y o rh o s t v a r i a b l e s f o r a r e s p e c t i v e d a t a b a s e q u e r y ;

    i n r e s p o n s e t o r e c e i v i n g a c u r r e n t d a t a b a s e q u e r y , i d e n t i f yi n g a p a r t i c u l a r s e t o f p a s t p e r f o r m a n c e s t a t i s t i c s f r o mamong t h e s e t s o f p a s t p e r f o r m a n c e s t a t i s t i c s f o r t h ep l u r a l i t y o f p r e v i o u s l y e x e c u t e d d a t a b a s e q u e r i e s t h a tr e l a t e s t o t h e c u r r e n t d a t a b a s e q u e r y ; and

    g e n e r a t i n g and s t o r i n g a n a c c e s s p l a n f o r t h e c u r r e n t d a t ab a s e q u e r y based t l e a s t i n p a r t on h e p a r t i c u l a r s e t ofp a s t p e r f o r m a n c e s t a t i s t i c s i d e n t i ? e d i n r e s p o n s e t or e c e i v i n g t h e c u r r e n t d a t a b a s e q u e r y .

    2 . The method f c l a i m 1 , w h e r e i n t h e s e t s o f p a s t p e r f o rmance statisti c s a r e c o l l e c t e d by a database m o n i t o r .

    3 . The method f c l a i m 1 , w h e r e i n t h e s e t s o f p a s t p e r f o rmance t a t i s t i c s comprise a d a t a b a s e t a b l e .

    4 . The method f c l a i m 3 , w h e r e i n t h e s t e p o f i d e n t i f y i n gf u r t h e r i n c l u d e s t h e s t e p o f :

    q u e r y i n g t h e d a t a b a s e t a b l e f o r r e c o r d s s i m i l a r t o t h e c u rr e n t d a t a b a s e q u e r y .

    5 . The method o f c l a im 1 , w h e r e i n t h e s t e p o f g e n e r a t i n gf u r t h e r i n c l u d e s t h e s t e p o f :s e l e c t i n g t h e a c c e s s p l a n from among p l u r a l i t y o f a c c e s s

    p l a n s t h a t would i m p l e m e n t t h e c u r r e n t d a t a b a s e q u e r y .6 . A ethod f o r g e n e r a t i n g an a c c e s s p l a n , t h e method

    c o m p r i s i n g t h e s t e p s o f :m a i n t a i n i n g i n n o n - v o l a t i l e memory r e s p e c t i v e s e t o f a s t

    p e r f o r m a n c e s t a t i s t i c s f o r e a c h o f a p l u r a l i t y o f p r e v io u s l y e x e c u t e d d a t a b a s e q u e r i e s , w h e r e i n e a c h s e t o fp a s t performance tatisti c s i n c l u d e s one r more of numb e r o f r o w s u p d a t e d , i ns e r t e d , o r d e l e t e d by a r e s p e c t i v ed a t a b a s e q u e r y , number f rows f e t c h e d by a r e s p e c t i v ed a t a b a s e q u e r y , e l a p s e d t i m e f o r a r e s p e c t i v e d a t a b a s eq u e r y , e s t i m a t e d c o m p l e t i o n t i m e f o r a r e s p e c t i v e d a t ab a s e q u e r y , e s t i m a t e d I / O o p e r a t i o n s f o r a r e s p e c t i v e

  • 8/13/2019 Us 20130013586

    12/13

    US 013/0013586 A 1

    d a t a b a s e q u e r y , a c t u a l l / O o p e r a t i o n s f o r a r e s p e c t iv ed a t a b a s e query o r h o s t v a r i a b l e s f o r a r e s p e c t i v e d a t ab a s e q u e r y ;

    i n r e s p o n s e t o r e c e i v i n g a c u r r e n t d a t a b a s e q u e r y , i d e n t i f yi n g a p a r t i c u l a r s e t o f p a s t p e r f o r m a n c e s t a t i s t i c s c o r r es p o n d i n g t o a p r e v i o u s l y e x e c u t e d d a t a b a s e q u e r y s i m il a r t o t h e c u r r e n t d a t a b a s e q u e r y ;

    a n a l y z i n g p e r f o r m a n c e o f a n a c c e s s p l a n i d e n t i ? e d W i t h i nt h e p a r t i c u l a r s e t o f ast p e r f o r m a n c e t a t i s t i c s i d e n t i ? e di n r e s p o n s e to r e c e i v i n g t h e c u r r e n t d a t a b a s e q u e r y ; and

    g e n e r a t i n g and t o r i n g a c u r r e n t a c c e s s p l a n f o r t h e c u r r e n td a t a b a s e q u e r y based t l e a s t i n p a r t on h e a c c e s s p l a n .

    7 . The method of c l a i m 6 , Wherein a JOIN o r d e r i n t h ea c c e s s p l a n i s u s e d When e n e r a t i n g t h e c u r r e n t a c c e s s p l a n .

    8 . The method f c l a i m 6 , W h e r e i n i n d e x i n f o r m a t i o n fromt h e a c c e s s p l a n i s used When g e n e r a t i n g t h e c u r r e n t a c c e s sp l a n .

    9 . The method f c l a i m 6 , W h e r e i n t h e a c c e s s p l a n i s u s e da s t h e c u r r e n t access p l a n .

    1 0 . The method f c l a i m 6 , W h e r e i n t h e s e t s o f a s t p e r f o rmance statisti c s a r e c o l l e c t e d by a database m o n i t o r .1 1 . The method f c l a i m 6 , W h e r e i n t h e s t e p o f i d e n t i f y i n gf u r t h e r i n c l u d e s t h e s t e p s o f :

    i d e n t i f y i n g a ? l e r e f e r e n c e d by t h e d a t a b a s e q u e r y ; andd e t e r m i n i n g i f t h e ? l e Was e - o r g a n i Z e d a f t e r e x e c u t i o n o f

    t h e a c c e s s p l a n .1 2 . The method f c l a i m 1 1 , W h e r e i n t h e s t e p o f d e t e r m i n

    i n g i n c l u d e s t h e s t e p o f :d e t e r m i n i n g i f one r more i n d i c e s r e l a t e d t o t h e ? l e have

    been e b u i l t s u b s e q u e n t t o e x e c u t i o n o f t h e a c c e s s p l a n .1 3 . The method f c l a i m 6 , W h e r e i n t h e s t e p o f a n a l y Z i n g

    i n c l u d e s t h e s t e p o f :d e t e r m i n i n g i f a n e x e c u t i o n t i m e o f t h e a c c e s s p l a n

    exceeded an e s t i m a t e d e x e c u t i o n t i m e .1 4 . The method f l a i m 1 3 , f u r t h e r c o m p r i s i n g t h e s t e p o f :i n c r e a s i n g t h e e s t i m a t e d e x e c u t i o n t i m e f o r t h e a c c e s s p l a n

    to a neW e s t i m a t ed e x e c u t i o n t i m e , i f t h e e x e c u t i o n timee x c e e d e d t h e e s t i m a t ed e x e c u t i o n t i m e .

    1 5 . A ethod f o r g e n e r a t i n g a n a c c e s s p l a n , t h e methodc o m p r i s i n g t h e s t e p s o f :

    m a i n t a i n i n g i n n o n - v o l a t i l e memory r e s p e c t i v e s e t o f a s tp e r f o r m a n c e s t a t i s t i c s f o r e a c h o f a p l u r a l i t y o f p r e v io u s l y e x e c u t e d d a t a b a s e q u e r i e s , W h e r e i n e a c h s e t o fp a s t performance tatisti c s i n c l u d e s one r more of numb e r o f o W s u p d a t e d , i n s e r t e d , o r d e l e t ed by a r e s p e c t i v ed a t a b a s e q u e r y , number f roWs f e t c h e d by a r e s p e c t i v ed a t a b a s e q u e r y , e l a p s e d t i m e f o r a r e s p e c t i v e d a t a b a s eq u e r y , e s t i m a t e d c o m p l e t i o n t i m e f o r a r e s p e c t i v e d a t ab a s e q u e r y , e s t i m a t e d l / O o p e r a t i o n s f o r a r e s p e c t iv ed a t a b a s e q u e r y , a c t u a l l / O o p e r a t i o n s f o r a r e s p e c t iv ed a t a b a s e query o r h o s t v a r i a b l e s f o r a r e s p e c t i v e d a t ab a s e q u e r y ;

    i n r e s p o n s e to r e c e i v i n g a c u r r e n t d a t a b a s e q u e r y , i d e nt i f yi n g a c u r r e n t a c c e s s p l a n to implement h e c u r r e n t d a t ab a s e q u e r y ;

    i n r e s p o n s e to r e c e i v i n g t h e c u r r e n t d a t a b a s e q u e r y , i d e nt i f y i n g a p a r t i c u l a r s e t o f p a s t p e r f o r m a n c e s t a t i s t i c sc o r r e s p o n d i n g t o a p r e v i o u s l y e x e c u t e d d a t a b a s e q u e r yt h a t used h e c u r r e n t a c c e s s p l a n ;

    a n a l y Z i n g p e r f o r m a n c e o f t h e p r e v i o u s l y e x e c u t e d d a t ab a s e q u e r y u s i n g t h e p a r t i c u l a r s e t o f p a s t p e r f o r m a n c es t a t i s t i c s i d e n t i ? e d i n r e s p o n s e t o r e c e i v i n g t h e c u r r e n td a t a b a s e q u e r y ;

    J a n . 1 0 , 2 0 1 3

    d e c i d i n g Whether t o r e - u s e t h e c u r r e n t a c c e s s p l a n f o r t h ec u r r e n t d a t a b a s e q u e r y based on h e a n a l y s i s of h e p e rf o r m a n c e o f t h e p r e v i o u s l y e x e c u t e d d a t a b a s e q u e r y ;and

    s t o r i n g t h e d e c i s i o n of hether o r e - u s e t h e c u r r e n t a c c e s sp l a n f o r t h e c u r r e n t d a t a b a s e q u e r y .1 6 . The method f l a i m 1 5 , f u r t h e r c o m p r i s i n g t h e s t e p o f :f o r c i n g a r e - o p t i m i Z a t io n t o g e n e r a t e a neW a c c e s s p l a n

    b a s e d on t h e a n a ly s i s o f t h e p e r f o r m a n c e o f t h e p r e v io u s l y e x e c u t e d d a t a b a s e q u e r y .

    1 7 . The method f c l a i m 1 5 , W h e r e i n t h e s e t s o f p a s t p e rformance t a t i s t i c s a r e c o l l e c t ed by a d a t a b a s e m o n i t o r .1 8 . A n p p a r a t u s c o m p r i s i n g :

    a t l e a s t one processor;a m e m o r y coupled With t h e a t l e a s t one r o c e s s o r ; anda program o d e r e s i d i n g i n me mory and x e c u t e d by h e a t

    l e a s t one r o c e s s o r , th e program code con?gured o :m a i n t a i n in n o n - v o l a t i l e me mory r e s p e c t i v e s e t o f a s t

    p e r f o r m a n c e s t a t i s t i c s f o r e a c h o f a p l u r a l i t y o f r e v io u s l y e x e c u t e d d a t a b a s e q u e r i e s , W h e r e i n t h e s e t s o fp a s t p e r f o r m a n c e s t a t i s t i c s a r e a s s o c i a t e d W i t h e s p e ct i v e d a t a b a s e q u e r i e s , W h e r e i n e a c h s e t o f a s t p e r f o rmance t a t i s t i c s includes one or more of number ofr o W s u p d a t e d , i ns e r t e d , o r d e l e t ed by a r e s p e c t i v ed a t a b a s e q u e r y , number of roWs f e t c h e d by a r e s p e ct i v e d a t a b a s e q u e r y , e l a p s e d t i m e f o r a r e s p e c t i v e d a t ab a s e q u e r y , e s t i m a t e d c o m p l e t i o n t i m e f o r a r e s p e ct i v e d a t a b a s e q u e r y , e s t i m a t e d l / O o p e r a t i o n s f o r ar e s p e c t i v e d a t a b a s e q u e r y , a c t u a l l / O o p e r a t i o n s f o r ar e s p e c t i v e d a t a b a s e query o r h o s t v a r i a b l e s f o r ar e s p e c t i v e d a t a b a s e q u e r y ;

    i n r e s p o n s e t o r e c e i v i n g a c u r r e n t d a t a b a s e q u e r y , i d e nt i f y a p a r t i c u l a r s e t o f a s t p e r f o r m a n c e s t a t i s t i c s f r o mamong t h e s e t s o f p a s t p e r f o r m a n c e s t a t i s t i c s f o r t h ep l u r a l i t y o f p r e v i o u s l y e x e c u t e d d a t a b a s e q u e r i e s t h a tr e l a t e s t o t h e c u r r e n t d a t a b a s e q u e r y ; and

    g e n e r a t e and s t o r e an a c c e s s p l a n f o r t h e c u r r e n t d a t ab a s e q u e r y b a s e d t l e a s t i n p a r t on h e p a r t i c u l a r set o fp a s t p e r f o r m a n c e s t a t i s t i c s i d e n t i ? e d in r e s p o n s e t or e c e i v i n g t h e c u r r e n t d a t a b a s e q u e r y .1 9 . The a p p a r a t u s o f c l a i m 1 8 , f u r t h e r c o m p r i s i n g :

    a d a t a b a s e o f a r e s p e c t i v e s e t o f a s t p e r f o r m a n c e s t a t i s t i c sf o r e a c h o f a p l u r a l i t y o f p r e v i o u s l y e x e c u t e d d at a b a s eq u e r i e s .

    2 0 . The a p p a r a t u s o f c l a i m 1 8 f u r t h e r c o m p r i s i n g :a database monitor con?gured o maintain a database of

    r e s p e c t i v e s e t o f a s t p e r f o r m a n c e s t a t i s t i c s f o r e a c h o f ap l u r a l i t y o f r e v i o u s l y e x e c u t e d d a t a b a s e q u e r i e s .2 1 . The p p a r a t u s o f l a i m 2 0 , W h e r e i n t h e program o d e s

    f u r t h e r con?gured o s e a r c h t h e d a t a b a s e f o r r e c o r d s s i m i l a rt o t h e c u r r e n t d a t a b a s e q u e r y .

    2 2 . The p p a r a t u s o f l a i m 1 8 , W h e r e i n t h e program o d e sf u r t h e r con?gured o s e l e c t t h e a c c e s s p l a n from p l u r a l i t y o fa c c e s s p l a n s t h a t Would implement t h e c u r r e n t d a t a b a s eq u e r y .2 3 . A r o g r a m p r o d u c t , c o m p r i s i n g :

    a program code con?gured upon e x e c u t i o n t o :m a i n t a i n in n o n - v o l a t i l e me mory r e s p e c t i v e s e t o f a s t

    p e r f o r m a n c e s t a t i s t i c s f o r e a c h o f a p l u r a l i t y o f r e v io u s l y e x e c u t e d d a t a b a s e q u e r i e s , W h e r e i n t h e s e t s o fp a s t p e r f o r m a n c e s t a t i s t i c s a r e a s s o c i a t e d W i t h e s p e ct i v e d a t a b a s e q u e r i e s , W h e r e i n e a c h s e t o f a s t p e r f o rmance t a t i s t i c s includes one or more of number ofr o W s u p d a t e d , i ns e r t e d , o r d e l e t ed by a r e s p e c t i v e

  • 8/13/2019 Us 20130013586

    13/13

    US 013/0013586 A 1

    d a t a b a s e q u e r y , number of roWs f e t c h e d by a r e s p e ct i v e d a t a b a s e q u e r y , e l a p s e d t i m e f o r a r e s p e c t i v e d a t ab a s e q u e r y , e s t i m a t e d c o m p l e t i o n t i m e f o r a r e s p e ct i v e d a t a b a s e q u e r y , e s t i m a t e d l / O o p e r a t i o n s f o r ar e s p e c t i v e d a t a b a s e q u e r y , a c t u a l l / O o p e r a t i o n s f o r ar e s p e c t i v e d a t a b a s e query o r h o s t v a r i a b l e s f o r ar e s p e c t i v e d a t a b a s e q u e r y ;

    i n r e s p o n s e t o r e c e i v i n g a c u r r e n t q u e r y , i d e n t i f y a p a rt i c u l a r s e t o f a s t p e r f o r m a n c e s t a t i s t i c s from amongt h e s e t s o f a s t p e r f o r m a n c e s t a t i s t i c s f o r t h e p l u r a l i t y

    J a n . 1 0 , 2 0 1 3

    o f r e v i o u s l y e x e c u t e d d a t a b a s e q u e r i e s t h a t r e l a t e s t ot h e c u r r e n t d a t a b a s e q u e r y ; and

    g e n e r a t e and s t o r e an a c c e s s p l a n f o r t h e c u r r e n t d a t ab a s e q u e r y b a s e d t l e a s t i n p a r t on h e p a r t i c u l a r set o fp a s t p e r f o r m a n c e s t a t i s t i c s i d e n t i ? e d in r e s p o n s e t or e c e i v i n g t h e c u r r e n t d a t a b a s e q u e r y ; and

    a c o m p u t e r - r e a d a b l e s t o r a g e medium s t o r i n g t h e p r o g r a mc o d e .