Re: [HACKERS] Case statement ready?

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org, jwieck(at)debis(dot)com, vadim(at)krs(dot)ru
Subject: Re: [HACKERS] Case statement ready?
Date: 1998-12-05 06:01:13
Message-ID: 3668CC28.30C5349C@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > For the costing I would assume
> > that the cost should be related to the sum of the costs of the
> > individual clauses within the CASE statement (or maybe half of the
> > sum).
> Isn't only one of the case values going to be used? Wouldn't you want
> the average of the case entry costs?

Hmm. Actually, on average half of the conditional clauses will be
evaluated, and then one of the result clauses will be evaluated. So
perhaps the cost should be:

(0.5*sum(conditional clauses))+avg(result clauses)

Or perhaps we should be pessimistic and leave off the 0.5.

- Tom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-12-05 06:03:22 Re: [HACKERS] Case statement ready?
Previous Message Bruce Momjian 1998-12-04 23:13:38 Re: [GENERAL] 6.4 ?