Re: [HACKERS] Case statement ready?

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] Case statement ready?
Дата
Msg-id 3668CC28.30C5349C@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] Case statement ready?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] Case statement ready?
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] Case statement ready?