Better name/syntax for "online" index creation - Mailing list pgsql-hackers

From Tom Lane
Subject Better name/syntax for "online" index creation
Date
Msg-id 10977.1153754035@sss.pgh.pa.us
Whole thread Raw
Responses Re: Better name/syntax for "online" index creation  (Rod Taylor <pg@rbt.ca>)
Re: Better name/syntax for "online" index creation  (Peter Eisentraut <peter_e@gmx.net>)
Re: Better name/syntax for "online" index creation  (Greg Stark <gsstark@mit.edu>)
Re: Better name/syntax for "online" index creation  (Paul Silveira <plabrh1@gmail.com>)
List pgsql-hackers
I'm fairly dissatisfied with the naming of Greg Stark's proposed new
feature for creating indexes without blocking writers of the table.
To my mind, "ONLINE" just doesn't convey any useful information ---
the existing CREATE INDEX functionality could already be said to be
"online", in the sense that you don't have to take down the database
to do it.  I thought about "SHARED" but someone could probably raise
the same objection to it.  Anyone have a better idea?

I'm also wondering about where in the command the keyword should go.
As submitted it's
     ( { <replaceable class="parameter">column</replaceable> | ( <replaceable
class="parameter">expression</replaceable>) } [ <replaceable class="parameter">opclass</replaceable> ] [, ...] )     [
WITH( <replaceable class="PARAMETER">storage_parameter</replaceable> = <replaceable
class="PARAMETER">value</replaceable>[, ... ] ) ]     [ TABLESPACE <replaceable
class="parameter">tablespace</replaceable>]
 
+     [ ONLINE]     [ WHERE <replaceable class="parameter">predicate</replaceable> ]

which seems a bit randomly chosen; what's more it creates a problem for
psql, which would have to parse nearly the entire command to discover
whether it's safe to execute inside a transaction block or not.
I'm tempted to put the new keyword at the very front:
SHARED CREATE INDEX ....

which would probably mean that we'd have to document it as if it were a
completely separate command from CREATE INDEX, but then again that might
not be a bad thing considering how differently the two cases behave.
If not that, we probably still need to put it somewhere near the front
for psql's sake.

Comments?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name
Next
From: Rod Taylor
Date:
Subject: Re: Better name/syntax for "online" index creation