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 1iziPy-00080d-77 for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2020 14:46:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iziPx-00032H-2O for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2020 14:46:09 +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 1iziPw-0002zR-HU for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2020 14:46:08 +0000 Received: from mail-yw1-f52.google.com ([209.85.161.52]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iziPK-0002hT-Cv for pgsql-hackers@postgresql.org; Thu, 06 Feb 2020 14:46:07 +0000 Received: by mail-yw1-f52.google.com with SMTP id z141so5059961ywd.13 for ; Thu, 06 Feb 2020 06:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SL0oq6zMHuyJsbSsJqhtZnZv/JPVeyfZJi7r581o0GY=; b=I9xIv2RBFiS92LqWsUAb/dqec26fVXzUh2gVaxttbz5SRQvqElOjrTwBxSYWFUOTPR prolD/twzqJWBR9SNDtEQzRpTSD2oVFzKdqXZ40OS588ZyydrkonVtDRawHaQHXKSYqx QHxOTevp2vzr9pMJMP5cGfuPr7SDX8gysgRplCrH0zrHt/IEb0SNld09PxbBKGWUpu6+ 58Tra52VuDr7nL6ClrGI4ZP2nWWZydIqNGeV6Uv/llF00L9CIXxQ8FcftlIhKGbsxcN9 rbFMcK6/i+SdINyWBXu7XiTmhdsbG+X4wl+wOzJ83HbpHuhBaZvvq9hGak6pLk0n0SGS JQ2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SL0oq6zMHuyJsbSsJqhtZnZv/JPVeyfZJi7r581o0GY=; b=t5OgTOFXpIQjDg6cTAqjPZhCSB3H89yWMbY9OL5aNz9wzj+mJhqaZIAdfHrffsfEPQ bSqhTYYFKbz8jpVw2gnftk7t46IBrF2s+K6UXgz05MhADsQYzhqCVBj7X/l+2Pb05lgH l1yWUvOtox1hp7AG4TXQ1sMyv6TiLD85QrTca8Y5+VwdAwTwXEIAD8qLDtx+zg8SrH4V ltBAvZSRXMrC867JEFqrX7ESpsnGWT/8w4yG7y57pBzG6iBVfndx7hik4DJuiCbN4KA9 aHpeSEBYxCHrLSxXGcqkFU4Ol94ushghe93cUEf/MhRHFkPSdlmSH90CY0MOcxNymOEl WHcg== X-Gm-Message-State: APjAAAUAMAoj5XkUyxl9/aprRklUqEYjMdwqZRHKf+Eypx2QMF7hvBAZ apzwRpgHOXW7t1wv7XK8VPuV7w== X-Google-Smtp-Source: APXvYqxksTh3jqeoA3soW7xO3Uw88+1i3wTZ/ZyEu5RV0aCYZfP6Ey7EuhZrlnT04jh+vnPwlY8kcw== X-Received: by 2002:a81:5008:: with SMTP id e8mr3628755ywb.34.1581000268937; Thu, 06 Feb 2020 06:44:28 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id e186sm1455086ywb.73.2020.02.06.06.44.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2020 06:44:27 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 758D2800926; Thu, 6 Feb 2020 08:44:26 -0600 (CST) Date: Thu, 6 Feb 2020 08:44:26 -0600 From: Justin Pryzby To: Amit Langote Cc: pgsql-hackers@postgresql.org Subject: Re: ALTER tbl rewrite loses CLUSTER ON index Message-ID: <20200206144426.GH403@telsasoft.com> References: <20200202161718.GI13621@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wondered if it wouldn't be better if CLUSTER ON was stored in pg_class as the Oid of a clustered index, rather than a boolean in pg_index. That likely would've avoided (or at least exposed) this issue. And avoids the possibility of having two indices marked as "clustered". These would be more trivial: mark_index_clustered /* We need to find the index that has indisclustered set. */