Re: Plan to support predicate push-down into subqueries with aggregates?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Plan to support predicate push-down into subqueries with aggregates?
Дата
Msg-id CAKFQuwYPEV4uY7MdP_VLk4Z9OvLmc9-wxZ9OOKzyfYNDvJ4XKw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Plan to support predicate push-down into subqueries with aggregates?  (rob stone <floriparob@gmail.com>)
Ответы Re: Plan to support predicate push-down into subqueries with aggregates?  (Adam Brusselback <adambrusselback@gmail.com>)
Список pgsql-general
On Wednesday, March 9, 2016, rob stone <floriparob@gmail.com> wrote:
On Wed, 2016-03-09 at 12:25 -0500, Adam Brusselback wrote:

Note that:- (a) I included header_description in the definition.
    (b) Removed some lines as if you want the total you may as well
include it in your select from the view, and for the life of me I
couldn't understand the purpose of:-

header.amount = coalesce(detail_1.amount, 0) +
coalesce(detail_2.amount, 0) as balanced

Is "balanced" supposed to be a boolean?

If you need header.amount include it in the view.


It's basically accounting.  Does the total amount on the header (header.amount) equal the sum of the two components (1.amount + 2.amount), returns true or false based upon the equality.  So not only do you need to compute 1.amount but you also need to immediately use it as part of an expression.  And return both usages from the view.

David J.

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

Предыдущее
От: rob stone
Дата:
Сообщение: Re: Plan to support predicate push-down into subqueries with aggregates?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Request - repeat value of \pset title during \watch interations