Re: [HACKERS] REINDEX CONCURRENTLY 2.0

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [HACKERS] REINDEX CONCURRENTLY 2.0
Дата
Msg-id 20181214143236.GQ3415@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: [HACKERS] REINDEX CONCURRENTLY 2.0  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: [HACKERS] REINDEX CONCURRENTLY 2.0  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Greetings,

* Peter Eisentraut (peter.eisentraut@2ndquadrant.com) wrote:
> On 14/12/2018 01:14, Stephen Frost wrote:
> >>>> reindex table CONCURRENTLY test;
> >>
> >> By the way, does this syntax make sense?  I haven't seen a discussion on
> >> this anywhere in the various threads.  I keep thinking that
> >>
> >>     reindex concurrently table test;
> >>
> >> would make more sense.  How about in combination with (verbose)?
> >
> > I don't think it's a mistake that we have 'create index concurrently'
> > and it certainly would seem odd to me for 'create index' and 'reindex
> > table' to be different.
> >
> > Certainly, from my recollection of english, you'd say "I am going to
> > reindex the table concurrently", you wouldn't say "I am going to
> > reindex concurrently the table."
> >
> > Based on at least a quick looking around, the actual grammar rule seems
> > to match my recollection[1], adverbs should typically go AFTER the
> > verb + object, and the adverb shouldn't ever be placed between the verb
> > and the object.
>
> So it would be grammatical to say
>
>     reindex table test concurrently

Yes, though I'm not really a fan of it.

> or in a pinch
>
>     reindex concurrently table test

No, you can't put concurrently between reindex and table.

> but I don't see anything grammatical about
>
>     reindex table concurrently test

I disagree, this does look reasonable to me and it's certainly much
better than 'reindex concurrently table' which looks clearly incorrect.

> Where this gets really messy is stuff like this:
>
>     reindex (verbose) database concurrently postgres
>
> Why would "concurrently" not be part of the options next to "verbose"?

That wasn't what was asked and I don't think I see a problem with having
concurrently be allowed in the parentheses.  For comparison, it's not
like "explain analyze select ..." or "explain buffers select" is
terribly good grammatical form.

If you wanted to try to get to a better form for the spelled out
sentence, I would think:

concurrently reindex table test

would probably be the approach to use, though that's not what we use for
'create index' and it'd be rather out of character for us to start a
command with an adverb, making it ultimately a poor choice overall.

Going back to what we already have done and have in released versions,
we have 'create unique index concurrently test ...' and that's at least
reasonable (the adverb isn't showing up between the verb and the object,
and the adjective is between the verb and the object) and is what I
vote to go with, with the caveat that if we want to also allow it inside
the parentheses, I'm fine with that.

Thanks!

Stephen

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: explain plans with information about (modified) gucs
Следующее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Row Visibility and Table Access Methods