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.92) (envelope-from ) id 1jHgBS-0001uZ-3Z for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2020 04:01:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHgBP-0003BU-Eo for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2020 04:01:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHgBP-0003BN-15 for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2020 04:01:23 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jHgBD-0006sW-Ip for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2020 04:01:22 +0000 Received: by mail-qt1-x82e.google.com with SMTP id f20so7576649qtq.6 for ; Thu, 26 Mar 2020 21:01:11 -0700 (PDT) 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=GkofJgdfS5vDFQgGhekqhgbY0ibeMjxasyz6M+3xt+M=; b=oLKMI3Vvbuejw8JPT2ClHMX8jAOTDj8nUHIgteRejKar5dkSVolsk7ScT5qTbOI3Nd HksZysj23mpBPQsXz2MEaGUOu8y0vL406//+yI1rDGJbbTJTAM6fTeCRUC5ZutDumsQB mO2qnewCfIrGRnlePJi3+vWTMDBpwa0862xtg4C0/3K80u7Tepdt38I6EiD/2qg+7XF8 ZcjwNwfaJV2QukF0IGMR3ILYk6x1QWjXuzfztEeoN/9xswWXQ5IC2w0QTGmAJZfc98iT NdYVB3+vq/J+jlg2prY6tyKxeoNQerEuLW+xZHvRsBjddvZrpmRoyGGHaDAQzA6XCZ4O ehGw== 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=GkofJgdfS5vDFQgGhekqhgbY0ibeMjxasyz6M+3xt+M=; b=W8B26+HMq9rt1Svtab/rVIlbTAeJCiejr4TQ1DxHJBkpCjjDplYOVUIbpyBjv6qQ2p E864H8uPv9MbeDgDlE7fMzjV8gvIFagReSeNfc6iZ3gnk2LEXU7PUmUNwLWWMj0SswHq yxPXWQOJH9VNVRfglB/vcY0m3W9d2ASQNcplZfqvW0UP+5cD/5P0BDzba3gL/eNrh8ZY wnWFFD0mXt1TfTWmSwpuHZIb2/0/pAh0jLAW+2wd9dojlYHvDC1yem4LfEwsxROf4GiU qQ8CutTydBcZ1HyjZGQcYD3il8Z+drDHurzMMFrJ25fdTeIJuYKEnIcMg2T+hOmTJeB7 C5Mw== X-Gm-Message-State: ANhLgQ1WAvfCyjzEAxFlFu4ezcKvcisDMYuYZfYAxIvq7kJV47dWC84M BU6alxkr8XLrhnGZRg2g64qj1g== X-Google-Smtp-Source: ADFU+vugVJI+lb14ywAYGFQLqQf4FPegu95CyYOgAU8jzWEQwCclRDgouibDN3BtdZLcy6yCs1twYg== X-Received: by 2002:ac8:fe9:: with SMTP id f38mr12117216qtk.130.1585281668953; Thu, 26 Mar 2020 21:01:08 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 68sm2867398qkh.75.2020.03.26.21.01.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 21:01:07 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 64D4C80096B; Thu, 26 Mar 2020 23:01:06 -0500 (CDT) Date: Thu, 26 Mar 2020 23:01:06 -0500 From: Justin Pryzby To: Alexey Kondratov Cc: Michael Paquier , Masahiko Sawada , Steve Singer , pgsql-hackers@lists.postgresql.org, Alvaro Herrera , Robert Haas , Alexander Korotkov , Masahiko Sawada , Jose Luis Tallon Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly Message-ID: <20200327040106.GC20103@telsasoft.com> References: <20191202082134.GI1696@paquier.xyz> <20200211164848.GO1412@telsasoft.com> <20200229145304.GI29456@telsasoft.com> <20200309200447.GA32459@telsasoft.com> <20200325234027.GH21443@telsasoft.com> <39a055a7a8cd19552f35f4cb98a8cd80@postgrespro.ru> <20200326180112.GH17431@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200326180112.GH17431@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > Another issue is this: > > +VACUUM ( FULL [, ...] ) [ TABLESPACE new_tablespace ] [ table_and_columns [, ...] ] > As you mentioned in your v1 patch, in the other cases, "tablespace > [tablespace]" is added at the end of the command rather than in the middle. I > wasn't able to make that work, maybe because "tablespace" isn't a fully > reserved word (?). I didn't try with "SET TABLESPACE", although I understand > it'd be better without "SET". I think we should use the parenthesized syntax for vacuum - it seems clear in hindsight. Possibly REINDEX should use that, too, instead of adding OptTablespace at the end. I'm not sure. CLUSTER doesn't support parenthesized syntax, but .. maybe it should? Also, perhaps VAC FULL (and CLUSTER, if it grows parenthesized syntax), should support something like this: USING INDEX TABLESPACE name I guess I would prefer just "index tablespace", without "using": |VACUUM(FULL, TABLESPACE ts, INDEX TABLESPACE its) t; |CLUSTER(VERBOSE, TABLESPACE ts, INDEX TABLESPACE its) t; -- Justin