Re: How to do faster DML

From: veem v <veema0000(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org, "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>, "David(dot)G(dot)Johnston(at)gmail(dot)com" <David(dot)G(dot)Johnston(at)gmail(dot)com>
Subject: Re: How to do faster DML
Date: 2024-02-16 06:40:20
Message-ID: CAB+=1TXBAwAoDywEFot0Zm00nH0_JNVk4CBvvLyFk2X3h7j=pQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 16 Feb 2024 at 06:04, Peter J. Holzer <hjp-pgsql(at)hjp(dot)at> wrote:

> On 2024-02-15 16:51:56 -0700, David G. Johnston wrote:
> > 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
> >
> >
>
> Thank You.

So it looks like the use cases where we don't need precision or decimal
point values to be stored in postgres , integer data type is the way to go
without a doubt.

However in cases of precision is required, as you all mentioned there are
certain issues(rounding error etc) with "Float" data type and considering a
normal developers usage point of view, it should be the Numeric type which
we should use. I think the consistent working or functionality of an
application takes precedence over performance. And I believe , in most real
life scenarios, when we need precisions we expect them to behave
consistently across all the application and database platforms(mainly
banking industries), and thus it seems Numeric data type is the safest one
to use as a multi database platform type. Please correct me if I'm wrong.

Regards
Veem

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sud 2024-02-16 06:52:46 Encryption Options
Previous Message Peter J. Holzer 2024-02-16 00:34:01 Re: How to do faster DML