pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Mike Lissner <mlissner@michaeljaylissner.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Does converting an indexed varchar to text rewrite its index? Docs say so, tests say no.
Date: Thu, 23 Jan 2020 11:28:44 -0800
Message-ID: <7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.com> (raw)
In-Reply-To: <CAMp9=EyEMDKswjY5r9F7B0b2_FaeY_oYVbze=aeBTEExuaC7RQ@mail.gmail.com>
References: <CAMp9=ExXtH0NeF+LTsNrew_oXycAJTNVKbRYnqgoEAT01t=67A@mail.gmail.com>
	<18e832ea-4bae-8c47-fdfe-e2cf316f52ce@aklaver.com>
	<CAMp9=EyEMDKswjY5r9F7B0b2_FaeY_oYVbze=aeBTEExuaC7RQ@mail.gmail.com>

On 1/23/20 11:17 AM, Mike Lissner wrote:
> Thanks Adrian. Is there a reason that the index rebuild is nearly 
> instant during the ALTER command as opposed to when you build it from 
> scratch?

Well it did not rebuilt the index("t1_name_idx") you created on name.

> 
> Does it have to do with why this is called a "toast" index?

Certain data types(those that have varlena) can have portions of their 
data stored in an auxiliary table in a compressed(or not) form. For all 
the details see:

https://www.postgresql.org/docs/12/storage-toast.html

The index is the one on this auxiliary table.

> 
> DEBUG:  building index "pg_toast_37609_index" on table "pg_toast_37609"
> 
> Thanks for the feedback. I really appreciate it and it's super 
> interesting to learn about.
> 
> Mike
> 



-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (9+ messages)  latest in thread

Message-ID: <7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.com>
Permalink:  ../7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.com/
Also on:    postgresql.org/message-id/7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.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: adrian.klaver@aklaver.com, mlissner@michaeljaylissner.com
  Subject: Re: Does converting an indexed varchar to text rewrite its index? Docs say so, tests say no.
  In-Reply-To: <7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.com>
  References: <CAMp9=ExXtH0NeF+LTsNrew_oXycAJTNVKbRYnqgoEAT01t=67A@mail.gmail.com> <18e832ea-4bae-8c47-fdfe-e2cf316f52ce@aklaver.com> <CAMp9=EyEMDKswjY5r9F7B0b2_FaeY_oYVbze=aeBTEExuaC7RQ@mail.gmail.com> <7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.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