Re: Disk space consumption: character varying(255) versus text used for index

Justin <[email protected]> Fri, 20 Dec 2019 14:06:17 -0500
Newsgroups gmane.comp.db.postgresql.novice
Message-ID <CALL-XeOFZ0sFuYFk-KLBhBu8DmArFkkKvPRXFwE5GisN04GBMA@mail.gmail.com>
--0000000000002fec54059a277117
Content-Type: text/plain; charset="UTF-8"

Have question this states the GUID  is the text Hex value form a UUID  if
so that 36bytes long  vs integer that is 128bits   if that is the case
convert this GUID to  UUID type

or am i missing something?

On Fri, Dec 20, 2019 at 1:55 PM Tom Lane <[email protected]> wrote:

> Marcel Ruff <[email protected]> writes:
> > my btree index for
> >    guid                | character varying(255)
> > is currently 6.9GB (almost all guid entries are of size 37bytes)
> > If I would change the data type to
> >   guid                | text
> > would the index size be reduced (without hitting performance)?
>
> Wouldn't make any difference at all.
>
>                         regards, tom lane
>
>
>

--0000000000002fec54059a277117
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Have question this states the GUID=C2=A0 is the text =
Hex value form a UUID=C2=A0 if so that 36bytes long=C2=A0 vs integer that i=
s 128bits=C2=A0=C2=A0 if that is the case convert this GUID to=C2=A0 UUID t=
ype=C2=A0 <br></div><div><br></div><div>or am i missing something?<br></div=
></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr"=
>On Fri, Dec 20, 2019 at 1:55 PM Tom Lane &lt;<a href=3D"mailto:[email protected]=
.pa.us">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">Marcel Ruff &lt;<a href=3D"mailto:[email protected]=
" target=3D"_blank">[email protected]</a>&gt; writes:<br>
&gt; my btree index for<br>
&gt; =C2=A0=C2=A0 guid=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | character varying(255)<br>
&gt; is currently 6.9GB (almost all guid entries are of size 37bytes)<br>
&gt; If I would change the data type to<br>
&gt; =C2=A0 guid=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | text<br>
&gt; would the index size be reduced (without hitting performance)?<br>
<br>
Wouldn&#39;t make any difference at all.<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 regards, tom lane<br>
<br>
<br>
</blockquote></div>

--0000000000002fec54059a277117--