Reuse of State value in Aggregates

Started by gg pwabout 4 years ago3 messages
#1gg pw
lucenaalmirjames123@gmail.com

Do Aggregate functions/queries reuse the state value they generate for
subsequent queries? If not then an explanation would be greatly
appreciated.

#2Antonin Houska
ah@cybertec.at
In reply to: gg pw (#1)
Re: Reuse of State value in Aggregates

gg pw <lucenaalmirjames123@gmail.com> wrote:

Do Aggregate functions/queries reuse the state value they generate for subsequent queries? If not then an explanation would be greatly appreciated.

The subsequent queries are not supposed to feed the same input into the
aggregates, so their aggregate states will most likely be different. Maybe you
need to post an example where you think such reusing would be useful.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

#3gg pw
lucenaalmirjames123@gmail.com
In reply to: Antonin Houska (#2)
Re: Reuse of State value in Aggregates

That's sufficient information for me thanks! I don't really have a concrete
example at the moment. The idea just popped up in my head when I read that
CTEs are reused inside parent queries.