Re: Query Size Estimation without Runing it

From: Larry Edelstein <lsedels_at_us.ibm.com>
Date: 2000/02/17
Message-ID: <38AC99CB.C333CFD0_at_us.ibm.com>#1/1


DB2 UDB has an optional product called Query Patroller. This product does not run the query, but uses the optimizer to determine what the relative query cost would be and then determines whether to run it or to defer it based on some pre-defined criteria.

quanunique_at_my-deja.com wrote:

> In article <88h22e$5u2$1_at_nnrp1.deja.com>,
> msharaf_at_main-scc.cairo.eun.eg wrote:
> > Hi
> >
> > Working in my research, i need to estimate the size of query
> > result (numder of tuples) without actually runing it, which is
> > a typical problem in query optimization.
> >
> > I wonder how can i do it in a simple & somehow efficient way,
> > The SQL Server Query Analyzer, do this in a very good way, i
> > wonder how it is doing it ?!!, does it keep some statistical data
> > somewhere in the database ?!! & i wonder if i can use it thru
> > programming, sending it the query & it returns back the estimated
> > number of tuples ?!!
> >
> > Thanks a lot in advance, Mohamed
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> The most accurate way is to run the query. But I don't think every
> optimizer can afford it. There are coarse way, for instance, System R
> assumed normal distribution of every attribute; there are also more
> accurate way, for instance, histogram can make the estimation pretty
> accurate. There are plentyof papers about this subject in SIGMOD and
> VLDB proceedings.
>
> Quan.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Feb 17 2000 - 00:00:00 CET

Original text of this message