Multiple Query Optimization with Depth-First Branch-and-Bound and ...

6 downloads 0 Views 541KB Size Report
Optimization with. Depth-First. Branch-and-Bound and. Dynamic. Query. Ordering. Ahmet. Cosar,. Ee-Peng. Lim,. Jaideep. Srivastava. Departmentof. Computer.
Multiple

Query

Optimization and

with

Dynamic

Ahmet

Cosar,

Depth-First

Query

Ee-Peng

Ordering

Lim,

Departmentof

Jaideep

Computer

University

of

Minneapolis,

Minnesota 55455

common mon

In

certain

database

databases,

batch

processing

etc.,

set ofclosely gether

in a single

Query (e.g.

common

plan) tic

can

forall function

and

and

existing ing. and

etc.)

dynamic

query

methods

which

experiments

dynamic

query

of our

ordering

h4Q0

and

and

that

required

static

query

to improve

dewith

is to the

order-

exploit

database

the

often

a group

cessing cially

for

for

the perfor-

and

of queries

execution. at

of

promise

deductive recursive

will

number

tasks In

query

processing, processing,

approach be

inefficient

of queries

in

certain

query

together

traditional

a time

is a high

(MQO)

common queries.

are submitted

The

one

there

optimization

of sharing

e.g.

processing

queries when

query

a group

applications,

query

DBMS

benefits

plans

batch

to be NP-hard

rapidly. effort

in several

papers[l

prunes

search

teeing

an optimal

MQO

Our

to the

One

of pro-

the

espe-

CIKM ’93-1 0

1993

l/93/D. ACM

433

are

A*

reported

algorithm

function

is

which

still

guarantech-

to handle

be solved

using

available

since

once the

plan(s)

and for

A* in

heuristics.

a plan

we have

adopted

also

at

to

the

group

of shared

the

used

However,

may

become

is merged discarded

becomes

of the

by

beginning

search.

a query

queries

shortcoming

in

ordering

between

remaining

is

error

heuristics

once the

for

work

the

amount

ordering only

Sellis’

and

a high

an initial

sharing

this

in

decrease

throughout that

account

heuristics

several

constant

multi-plan,

have

computed

observed

ineffective,

ing

of little

or variation

annealing

function

which

are

remain

To

cannot

so as to

calculation

There which

native

expansion,

states

while

parameters

of queries

cost

we have

. . ..$1.50

fundamental

queries

C., USA 0-89791-626-3/93/0011

the currently

together

the

search

analyzed

that

heuristic

and

space

state

Simulated

time

with

prob-

algorithm

heuristics

experimentally

on

MQO

has been

effectively

the

search

[4], Sellis’

problems

ordering

Sellis

a state

problem

solution.

queries

depending the

as the

an improved

been

addressed

eliminate

In

by a

[3]

improvement

MQO

more

guided

contributions:

of the

task(s). Permission to copy without fee all or part of this materisi is gmnted provided that the copies m. not mad. or distributed for direct commercial advantage, tha ACM copyright notica and tha titla of tha publication and ita data appaar, and rwtica ia @van that copying ia by perm”aaion of tha Association for Computing Machinary. To copy otharwiaa, or to republish, raquiras a faa orrdkrr specifk permission.

to

query a set of

of the

and intelligent

O, 4, 9].

space

also

a reasonable

sharing

on the

by having

larger

gave

Subsequent

of Sellis’s

has

and

ordering,

of the

all

showed

is used

functions

al

et

prob-

Chakravarthy

of detail,

Sellis

the

to represent

et

been

Grant

to

algorithm

levels

A*

has

14].

version

to evaluate

[15], 14].

query

nique

used

used.

[13,

tasks

analysis.

Chakravarthy

lem

common

approach

graph,

at various

measure

on

based

decomposition

cost

an in-

queries

an extended

was

the

com-

creates

[1, 6, 2, 13,

connection

problem

based

algorithm.

of multiple

called

wit h bounding

DFBB,

in which

sub-expression

[2], used

A query

revised

objective

access

Minker

formulation

Introduction

The

of common

and

identifies

and

multiple

a decade

a depth-first

lem

MQO

plan

processing

simultaneously.

heuristics,

of f.,

of

MQO

queries

once.

almost

[7] used

queries.

out-

are

execution

set of heuristics

heuris-

compared

all three

help

a set

predicates. among

only

idea for

graph[17],

(multi-

anew

(DFBB)

use A* show

the

ordering

evaluated,

al

task(s)

plan

paper,

Branch-and-Bound

The around

Multiple

among

unified

to obtain In this

a

can

all to-

common

joins,

at once.

into

and

query

are evaluated

of executing this,

relations

sub-expressions

tegrated

query

benefits

instead

a single

experimentally

Our

mance

1

(f=),

deductive

queries

to achieve identifies

be executed

Depth-First

jined

creates

queries

of related

order

(MQO)

and

Great

multi-plan In

as

recursive

can be transformed

subezpressions,

plans

which

puts

unijied

and

queries.

a group

separately.

Optimization

of query

query

database

by executing

each query

such

processing,

a single

related

be obtained

applications

query

Srivastava

Science

MN

Abstract

Branch-and-Bound

invalid.

query

a set of dynamic

with alter-

orderquery

ordering

algorithms

merged

with

on the

plan.

gains

the order

multi-plan

current

a new

so that

the

partial

multi-plan

Experimental

are obtained

in which

dynamically to

results

that

by

query

ation,

A a

second

Depth-First

algorithm

DFBB

domain.

and

function cost

a good tion

used

his A*

for

(f.)

initial

upper the

query)

and

Equipped

with

namic

query

method

Lastly,

prune

the

ordering

to adjust search

much

better

search

also helps

the heuristic merge”

adding the

the

to the

definition

section

3.

function

of

In

(~s)

ciding

the

than

when

initial

the

section

cost the

multi-plan

5.1.

set of query obtained presented

problem. algorithms

We

using

to the

Pl,l

=

Pz,l

=

task

Problem

problem

section, which

P2,1 ,P2,2 each

and

with

the

dy-

use of

Q2 have =

{~4)t5}

{tl,

t6, t7};

P2,3.

our

and

ordering tables

in section

new us

P2,2

=

{~2,~8,~9};

cost

ts

tq

30

5

35201055

I 40

t~

is due

section on the

heuristics

a

t7

=

sets:

{~5,~10}

t&J tg

tlil

10

Six

solutions

are possible,

cost(s(Pl,l

, P2,1))=

cost(s(Pl,l

, P2,2))=

COSt(S(Pl,l

, P2,3))=

cost(s(Pl)2)

P2,1))=

cost(s(P1,2

, P2,2))=

cost(s(pl,z

, P2,3))=

with

the

following

Cost(tl)+cost(tz

30

cost(tG)+cost(tT)=

90

Cost(tl)+cost(tz

)+cost(ts)+ (tg )=

COSt(tI)+COSt(t2

90

)+ COSt(ts)+

The

A Sucfor We

are

de-

with Our

and

minimum

necessarily each

)+cost(t5)+ 100

cost(tq)+cost(ts)

conclu-

query.

MQO

It may

plan

without

+cost(tlo)=

well any

85

15].

separately.

434

In

It would

sufficient an that

optimal case

such

queries

is not for

that

an

a shared

exists

a cheaper

other

on the has

P2,3}.

having

plans

be an interesting set

Q2

plans

necessary

there

conditions plan

optimal

with

and

is {PI,2,

a plan

tasks

QI

respectively.

multi-plan

always

case that

shared

45,

individual

include

be the

queries

however,

it is not will

the

55 and

an optimal

up of the

multi-plan.

query.

that

Similarly,

tssk.

for

costs

multi-plan,

to note

multi-plan

that

plans

with

cost

to determine of the

cost

made

optimal

are

7.

a formulation

110

cost(t2)+cost(t4

P2,2,

It is important

in those

which

minimum

P1,2

The

then

an experimental

6.

)+cost(t5)+

heuristic

5.

in [15],

125

cost(tl)+cost(t4

cost(ts)+cost(tg)=

expand

costs:

)+cost(ts)+

cost(tG)+cost(tT)= in

heuristics

results

in section

to Sellis[14,

task

1’2,3

t6

cost (ts)+cost

Formulation we present

is

cost.

TABLE

tz

heuristic to

algorithm.

ordering

heuristics

compared

A plan

are:

examine

proposed

in

query

two

and P1,2

the following

1’1,2

of

MQO

is introduced

bound

with

P1,l

a positive

t2, t3};

COST

such In this

problem

Q1 has plans

{tl,

tl

optimal 2

for Q1 and

costs

I

2 gives for

our

A*

algorithm

three

are presented

) is minimal.

1:

the plans

dy-

used for

We

enables

previously

applied

ran

by query

it

of the

the

number

Section

MQO

dynamic

plans

cost(S*

MQO

Query

Q2 has plans

by considering

search

the

upper

new

that

a sample

query

The

of calcu-

is the operation

that

cost

solu-

par-

The

the

4, we present

show

Augmentation

present

sions

and

less states

function

the

section

(f,)

cessive

algorithms.

as follows.

of various

in the

) is the

cost(t5)+cost(t10)=

is structured

suitability

much

current

1 shows

and five plans.

effectively. and

as it reduces which

of tasks

is demonstrated

to reduce

function

set

cost(t~,j

S* is such

outline:

paper

formal

A*

solution

Example

task(s).

Paper Our

than

operations,

a plan

shared

DFBB

of plans

show thus

ordering

more

is a set

n}.

j~T~)

up of a set of tasks,

Let

the

current

function,

heuristic,

depth “plan

space

heuristic

~(t~

Cost(tf,j).

of

problem

be the

while

heuristic

(and

query

cost

MQO

made

Successive

the

the

=

Example

for

experimentally

with

to

P2,S2, “ ‘ “,l’n,.

cost(S)

queries

(ii)

to calculate

plan

{t~,j, t~,j, ....t~~’}.

U(l

Suggest Documents