From: Jan Kohnert <nospam001-lists@jan-kohnert.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Implementing product-aggregate
Date: Thu, 14 Mar 2024 19:26:57 +0100
Message-ID: <2646220.k3LOHGUjKi@kohni-mobil> (raw)
In-Reply-To: <2208194.1710425878@sss.pgh.pa.us>
References: <2176491.irdbgypaU6@kohni-mobil>
<9247987.CDJkKcVGEf@kohni-mobil>
<2208194.1710425878@sss.pgh.pa.us>
Hello,
Am Donnerstag, 14. März 2024, 15:17:58 CET schrieb Tom Lane:
> I wouldn't be concerned about relying on numeric_mul (or any of the
> other functions underlying standard operators). They're undocumented
> only because documenting both the functions and the operators would
> bloat the documentation to little purpose. Using one makes your code
> not so portable to non-Postgres DBMSes, but you already crossed that
> bridge by deciding to use a custom aggregate.
thank you for clearifying this. We're not too concerned about portability. Let's face
the facts: Porting a reasonably complex database and the application using it
from one DBMS to another will almost certainly introduce an awful lot of
portability issues (f.e. the pseudo-types (big)serial, upserts, differences in merge
implementations, progammability, and so on). My main concern was, that
undocumented features sometimes tend to change without notice, since users
are not expected to use them..
> A bigger question is whether this implementation actually has the
> properties you want --- notably, maybe you should be using type
> float8 not numeric. Numeric would get pretty slow and be carrying
> an awful lot of decimal places by the end of the query, I fear.
This needs to be checked on our side. I was expecting, that using an aggregate
this way would be significantly faster than using exp(sum(log())). Though we're
not multiplying too many lines in a statement, if using the aggregate slows down
performance, we should propably stick the old way doing it.
Best regards!
--
MfG Jan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: nospam001-lists@jan-kohnert.de
Subject: Re: Implementing product-aggregate
In-Reply-To: <2646220.k3LOHGUjKi@kohni-mobil>
References: <2176491.irdbgypaU6@kohni-mobil> <9247987.CDJkKcVGEf@kohni-mobil> <2208194.1710425878@sss.pgh.pa.us> <2646220.k3LOHGUjKi@kohni-mobil>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox