Re: How to do faster DML

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to do faster DML
Date: 2024-02-15 23:51:56
Message-ID: CAKFQuwYGomKiqUcTwg==vDKY1-3K++jLZhYWcU0zkTaF91CkcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 15, 2024 at 4:31 PM Peter J. Holzer <hjp-pgsql(at)hjp(dot)at> wrote:

> On 2024-02-14 22:55:01 -0700, David G. Johnston wrote:
> > On Tuesday, February 13, 2024, veem v <veema0000(at)gmail(dot)com> wrote:
> >
> > float data types rather than numeric. This will give better
> performance.
> >
> >
> > Only use an inexact floating-point data type if you truly understand
> what you
> > are getting yourself into. Quickly getting the wrong answer isn’t
> tolerable
> > solution.
>
> Do NOT assume that a decimal type (even if it can grow to ridiculuous
> lengths like PostgreSQL's numeric) is exact in the mathematical sense.
> It isn't. It cannot represent almost all real numbers
>

That is an unusual definition for exact, I wouldn't have considered the
requirement to represent all real numbers to be included in it.

What you see with an exact type is what you get, which allows for
implementing equality, unlike inexact which requires epsilon checking.
That you need to round some values to the nearest exact value is true but
doesn't make represented values less exact. But yes, numbers in computers
are complicated and require attention to use. But not having to worry
about epsilon is still a win.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2024-02-16 00:12:16 Re: Using a Conversion Table
Previous Message Peter J. Holzer 2024-02-15 23:51:52 Re: PostgreSQL DB in prod, test, debug