You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by "Heather, James (ELS)" <ja...@elsevier.com> on 2016/06/24 10:33:15 UTC

Online schema changes

Is there any documentation anywhere to say what schema changes can be performed online (without write-locking a whole table)?

For instance (but not exclusively): adding or deleting a column on a large table.

James

________________________________

Elsevier Limited. Registered Office: The Boulevard, Langford Lane, Kidlington, Oxford, OX5 1GB, United Kingdom, Registration No. 1982084, Registered in England and Wales.

Re: Online schema changes

Posted by James Taylor <ja...@apache.org>.
Hi James,
We don't hold locks on tables during DDL operations (other than for the one
operation that updates the system catalog with the new mutations). Adding a
column does not require any additional data-related operations as existing
rows will simply return null for the column. For deletion of columns, we
add delete markers for any existing rows, so this can take time.

FWIW, there's work pretty far along on the encodecolumns branch that'll
allow for these delete markers to be placed asynchronously (along with
enabling column renaming). That functionality is targeted for 4.9 release.

Thanks,
James

On Fri, Jun 24, 2016 at 12:33 PM, Heather, James (ELS) <
james.heather@elsevier.com> wrote:

> Is there any documentation anywhere to say what schema changes can be
> performed online (without write-locking a whole table)?
>
> For instance (but not exclusively): adding or deleting a column on a large
> table.
>
> James
>
> ------------------------------
>
> Elsevier Limited. Registered Office: The Boulevard, Langford Lane,
> Kidlington, Oxford, OX5 1GB, United Kingdom, Registration No. 1982084,
> Registered in England and Wales.
>