pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: UUID or auto-increment
Date: Mon, 10 Aug 2020 14:56:37 -0600
Message-ID: <aa7b6e3d-2892-090a-99cb-61d4c29f7304@gmail.com> (raw)
In-Reply-To: <20200810165332.GV29590@tamriel.snowman.net>
References: <CAHaowgVasGvbuEBW4Fh-4ke31A9YfAF=VO5yk0OwS+0TT+azrw@mail.gmail.com>
<837516231.2607507.1597077490690@mail.yahoo.com>
<2663a1f2-7377-58e7-ad7d-a867fe75cb15@gmail.com>
<20200810165332.GV29590@tamriel.snowman.net>
On 8/10/20 10:53 AM, Stephen Frost wrote:
> Greeitngs,
>
> * Ron (ronljohnsonjr@gmail.com) wrote:
>> On 8/10/20 11:38 AM, Ravi Krishna wrote:
>>> Finally UUID results in write amplication in wal logs. Keep that in mind
>>> if your app does lot of writes.
>>
>> Because UUID is 32 bytes, while SERIAL is 4 bytes?
>
> and because it's random and so will touch a lot more pages when you're
> using it...
>
> Avoid UUIDs if you can- map them to something more sensible internally
> if you have to deal with them.
>
> Thanks,
>
> Stephen
>
I suspect the increased storage cost is more related to the size of the
record than to the ratio of the data types.
What says two consecutively saved records ought to be stored on the same
page or will likely be sought with the same search criterion. Serial
ids put a time order (loosely) on the data which may be completely
artificial.
view thread (13+ messages) latest in thread
Message-ID: <aa7b6e3d-2892-090a-99cb-61d4c29f7304@gmail.com> Permalink: ../aa7b6e3d-2892-090a-99cb-61d4c29f7304@gmail.com/ Also on: postgresql.org/message-id/aa7b6e3d-2892-090a-99cb-61d4c29f7304@gmail.com ·
reply
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: robjsargent@gmail.com Subject: Re: UUID or auto-increment In-Reply-To: <aa7b6e3d-2892-090a-99cb-61d4c29f7304@gmail.com> References: <CAHaowgVasGvbuEBW4Fh-4ke31A9YfAF=VO5yk0OwS+0TT+azrw@mail.gmail.com> <837516231.2607507.1597077490690@mail.yahoo.com> <2663a1f2-7377-58e7-ad7d-a867fe75cb15@gmail.com> <20200810165332.GV29590@tamriel.snowman.net> <aa7b6e3d-2892-090a-99cb-61d4c29f7304@gmail.com> * 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