[
https://issues.apache.org/jira/browse/PHOENIX-4484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16400810#comment-16400810
]
James Taylor commented on PHOENIX-4484:
---------------------------------------
Global indexes are populated by running a statement like this:
{code}
UPSERT INTO <index_table> SELECT <indexed columns> FROM <data_table>
{code}
So the source table is the data table and the target table is the index table.
The upper timestamp bound is based on when the CREATE INDEX statement was
started. While the population is occurring, the index will be maintained as
writes occur to the data table in the standard manner.
The building is done by MetaDataClient.buildIndex() and the code that builds
the UPSERT SELECT statement is PostIndexDDLCompiler. You'll see in
MetaDataClient.getMutationPlanForBuildingIndex() that there's a separate code
path for local index.
> Write directly to HBase when creating an index for transactional table
> ----------------------------------------------------------------------
>
> Key: PHOENIX-4484
> URL: https://issues.apache.org/jira/browse/PHOENIX-4484
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Ohad Shacham
> Assignee: Ohad Shacham
> Priority: Major
>
> Today, when creating an index table for a non empty data table. The writes
> are performed using the transaction api and both consumes client side memory,
> for storing the writeset, and checks for conflict analysis upon commit. This
> is redundant and can be replaced by direct write to HBase. For this reason, a
> new function in the transaction abstraction layer should be added that writes
> directly to HBase at the Tephra's case and adds shadow cells with the fence
> id at the Omid case.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)