[ 
https://issues.apache.org/jira/browse/PHOENIX-6860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680070#comment-17680070
 ] 

Kadir Ozdemir commented on PHOENIX-6860:
----------------------------------------

[~tkhurana], CREATE and UPSERT are different statements. So, having a separate 
get table call to  MetadataRegionObserver, one for the CREATE statement and the 
other for UPSERT, is expected.  I investigated this further and noticed that 
when auto commit is set to true, the Phoenix client calls 
ConnectionQueryServicesImpl#getTable() for each batch of an UPSERT SELECT 
statement. When the batch API (addBatch and executeBatch) is used and auto 
commit is set to true, the Phoenix client calls 
ConnectionQueryServicesImpl#getTable() for each row written to the same table 
within a batch.

I think we should fix the UPSERT SELECT case here as UPSERT SELECT is usually 
used within an auto-commit connection. The UPSERT case should be fixed in 
PHOENIX-6821 by [~haridsv] or after PHOENIX-6821 is fixed.

[~palashc], do you know another code path were the Phoenix client calls 
ConnectionQueryServicesImpl#getTable() for the same statement?

> Multiple calls for the same table to ConnectionQueryServicesImpl#getTable 
> within the execution of the same statement
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6860
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6860
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.1.2, 5.1.3
>            Reporter: Tanuj Khurana
>            Assignee: Kadir Ozdemir
>            Priority: Major
>
> For some statements like for example UPSERT statements, we make multiple 
> calls to ConnectionQueryServicesImpl#getTable() for the same table like once 
> in FromCompiler when creating the table ref and again when sending mutations 
> in MutationState#validateAndGetServerTimestamp(). I think we can reduce the 
> unnecessary RPCs to the server if we have already resolved the table for a 
> given statement.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to