Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iui9t-0004O8-NT for pgsql-general@arkaria.postgresql.org; Thu, 23 Jan 2020 19:28:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iui9s-0000KZ-6l for pgsql-general@arkaria.postgresql.org; Thu, 23 Jan 2020 19:28:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iui9q-0000KS-F5 for pgsql-general@lists.postgresql.org; Thu, 23 Jan 2020 19:28:51 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iui9n-0005uX-4E for pgsql-general@lists.postgresql.org; Thu, 23 Jan 2020 19:28:49 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 31F6C21EBC; Thu, 23 Jan 2020 14:28:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 23 Jan 2020 14:28:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=7 9p45+Lqd0yRLWs8I0aYWk2nMmjFwMSt+XKW4hL7xeM=; b=hqGxirTNEkZxF6ogG COeieAviKo8qvm04/+FFpYCHZdHc0vmYZnpz8wJTeyni4DZyRRiuicM1sVzksqSx znXWDoy8AEmMtxt+5MBP5Z4X7gr5GfAH/oVL9DGONGzBL9kDhgwcm1sSkU+YNc24 prpnd3IEXmrrPakbnly78U6W7wlQgjKF/KBEHLbgwnjqenTJgHOKzcKZvjUYOqLM cXwvi7quGiczPnecllTlHgbGG6TjpVVsVKlXjnwgZBf6+0XaefLgA0Nkd1mEPcWB Few4uNKPmT3np/Y1Vg4SaUTE9n85noHRInrLOrw85BRq20JQniG94jWghLLZrOkM 9vr/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=79p45+Lqd0yRLWs8I0aYWk2nMmjFwMSt+XKW4hL7x eM=; b=NwNEr3T6IBjwTESB6h9zubKRJCt0EQyHuCIY6oZn9+6VrhPaj6OUMHNFL abtTg0wxMwiQHWzLXamamxGLmKTfuO/BGeT/Sj+2WFKRV9QwqwL/EYpDjG6lJHxs KpnoTDHi6T55ZnnOXUqcj+zPRpkOz0WI199YTBfPf09zCZAOH8j/lpIy3zPTE2xf 4lhfRVI77DJZJiLrkKMUDSGPlqHtpo1xBSHjtBqXVrythCNObOOYBw8r+FXZ99gH /XZ5O8InFC0A46W5nKoIDSJBCdOrLJDohY33lcSZJI24LPxhYJo19PQeyfY779KH vIb99DGLeerAu+OwWC+oexrA+rl8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrvddvgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjeegrdelfedr uddthedrudekieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (74-93-105-186-washington.hfc.comcastbusiness.net [74.93.105.186]) by mail.messagingengine.com (Postfix) with ESMTPA id 57E6D328005E; Thu, 23 Jan 2020 14:28:45 -0500 (EST) Subject: Re: Does converting an indexed varchar to text rewrite its index? Docs say so, tests say no. To: Mike Lissner Cc: pgsql-general@lists.postgresql.org References: <18e832ea-4bae-8c47-fdfe-e2cf316f52ce@aklaver.com> From: Adrian Klaver Message-ID: <7c433efb-0a46-1ab2-930a-04e83efa31af@aklaver.com> Date: Thu, 23 Jan 2020 11:28:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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