Re: Proposal : REINDEX xxx VERBOSE

From: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal : REINDEX xxx VERBOSE
Date: 2015-03-11 12:37:09
Message-ID: CAD21AoAJW6u9imVWpttf42eQL4WXasoGnfmexEWVzEeD4gbuqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 10, 2015 at 5:05 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 3/9/15 9:43 PM, Sawada Masahiko wrote:
>>
>> On Fri, Mar 6, 2015 at 11:07 AM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
>> wrote:
>>>
>>> On 3/2/15 10:58 AM, Sawada Masahiko wrote:
>>>>
>>>>
>>>> On Wed, Feb 25, 2015 at 4:58 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
>>>> wrote:
>>>>>
>>>>>
>>>>> On 2/24/15 8:28 AM, Sawada Masahiko wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> According to the above discussion, VACUUM and REINDEX should have
>>>>>>> trailing options. Tom seems (to me) suggesting that SQL-style
>>>>>>> (bare word preceded by WITH) options and Jim suggesting '()'
>>>>>>> style options? (Anyway VACUUM gets the*third additional* option
>>>>>>> sytle, but it is the different discussion from this)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Well, almost everything does a trailing WITH. We need to either stick
>>>>> with
>>>>> that for consistency, or add leading () as an option to those WITH
>>>>> commands.
>>>>>
>>>>> Does anyone know why those are WITH? Is it ANSI?
>>>>>
>>>>> As a refresher, current commands are:
>>>>>
>>>>> VACUUM (ANALYZE, VERBOSE) table1 (col1);
>>>>> REINDEX INDEX index1 FORCE;
>>>>> COPY table1 FROM 'file.txt' WITH (FORMAT csv);
>>>>> CREATE MATERIALIZED VIEW mv1 WITH (storageparam, ...) AS qry WITH
>>>>> DATA;
>>>>> CREATE EXTENSION ext1 WITH SCHEMA s1 VERSION v1 FROM over;
>>>>> CREATE ROLE role WITH LOGIN;
>>>>> GRANT .... WITH GRANT OPTION;
>>>>> CREATE VIEW v1 AS qry WITH CASCADED CHECK OPTION;
>>>>> ALTER DATABASE db1 WITH CONNECTION LIMIT 50;
>>>>> DECLARE c1 INSENSITIVE SCROLL CURSOR WITH HOLD;
>>>
>>>
>>>
>>> BTW, I'm fine with Tom's bare-word with WITH idea. That seems to be the
>>> most
>>> consistent with everything else. Is there a problem with doing that? I
>>> know
>>> getting syntax is one of the hard parts of new features, but it seems
>>> like
>>> we reached consensus here...
>>
>>
>> Attached is latest version patch based on Tom's idea as follows.
>> REINDEX { INDEX | ... } name WITH ( options [, ...] )
>
>
> Are the parenthesis necessary? No other WITH option requires them, other
> than create table/matview (COPY doesn't actually require them).
>
>>>> We have discussed about this option including FORCE option, but I
>>>> think there are not user who want to use both FORCE and VERBOSE option
>>>> at same time.
>>>
>>>
>>>
>>> I find that very hard to believe... I would expect a primary use case for
>>> VERBOSE to be "I ran REINDEX, but it doesn't seem to have done
>>> anything...
>>> what's going on?" and that's exactly when you might want to use FORCE.
>>>
>>
>> In currently code, nothing happens even if FORCE option is specified.
>> This option completely exist for backward compatibility.
>> But this patch add new syntax including FORCE option for now.
>
>
> I forgot that. There's no reason to support it with the new stuff then.
>
> --
> Jim Nasby, Data Architect, Blue Treble Consulting
> Data in Trouble? Get it in Treble! http://BlueTreble.com

Attached patch is latest version patch changed syntax a little.
This patch adds following syntax for now.
REINDEX { INDEX | ... } name WITH (VERBOSE);

But we are under the discussion regarding parenthesis, so there is
possibility of change.

Regards,

-------
Sawada Masahiko

Attachment Content-Type Size
000_reindex_verbose_v4.patch application/octet-stream 15.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Asif Naeem 2015-03-11 13:03:44 Re: Install shared libs in lib/ and bin/ with MSVC (Was: install libpq.dll in bin directory on Windows / Cygwin)
Previous Message Etsuro Fujita 2015-03-11 11:40:02 Re: EvalPlanQual behaves oddly for FDW queries involving system columns