| From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
|---|---|
| To: | David Rowley <dgrowleyml(at)gmail(dot)com> |
| Cc: | Andreas Karlsson <andreas(at)proxel(dot)se>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Add sortsupport to money_ops, pg_lsn_ops and xid8_ops |
| Date: | 2026-12-04 19:52:06 |
| Message-ID: | CADkLM=c6ECBAY9MHEb7Ag3NZS5=o6QE+czqpTMEjJQqq1nEcig@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Dec 3, 2026 at 3:58 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> On Thu, 3 Dec 2026 at 10:07, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
> wrote:
> > 2. customers with at least 1 money column: 2.68%
>
> > I had hoped that this research would show that usage was vanishingly
> small, giving us a reason to pursue a more aggressive deprecation schedule,
> but that doesn't appear to be the case.
>
> Yeah. I'm surprised. Could you get some stats on indexes using money_ops?:
> e.g:
>
> SELECT count(*) FROM pg_index WHERE (SELECT oid FROM pg_opclass WHERE
> opcname = 'money_ops') = ANY (indclass::oid[]);
>
My understanding was that the data comes from logs and not direct access to
customer machines. I've been keen to not pry too much into how the data
sausage is made to protect my ability to make future requests.
My experience with other cloud vendors is that direct fleet inspections are
possible, but there's a lot of hoops to jump through and the juice is
rarely worth the bureaucratic squeeze.
In theory, if we were to ever move money to contrib, then providing
> another type based on int64 / 100 and adding a WITHOUT FUNCTION cast
> would allow switching to the new type without table rewrites.
>
Moving it to contrib further helps shun the type, but doesn't actually
lower our maintenance overhead, though it does de-prioritize that
maintenance somewhat.
This may sound fanciful, but would it make sense to change the primary name
of the money type to "cents" or "iso_4217_2_decimal" [1] or some other name
that clarifies the limited utility of the datatype? An unattractive name
could help customers to deprecate the type for us.
[1] https://en.wikipedia.org/wiki/ISO_4217
> I once wrote a type called fixeddecimal [1] which does that, same as
> money. The following seems to work without a table rewrite.
>
> ...
>
> But it's slow if you create an index on m(a) as the index needs rebuilt.
>
The indexes do appear to be the main barrier. I'll reach out to my contact
to see if we can triangulate money index usage in some way.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Si, Evan | 2026-12-04 20:03:01 | Re: [PATCH] Clarify that ssl_groups is for any key exchange groups |
| Previous Message | Greg Burd | 2026-12-04 19:51:25 | Re: Compute the distance between a point and a box exactly |