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

James Taylor commented on PHOENIX-1270:
---------------------------------------

I meant to add a new boolean column on SYSTEM.CATALOG called something like 
UNALTERABLE (see CREATE TABLE statement for SYSTEM.CATALOG in 
QueryConstants.java). It would default to false, but when you create the table 
you'd be able to set it to TRUE, like this:
{code}
    CREATE TABLE t (k VARCHAR PRIMARY KEY, v VARCHAR) UNALTERABLE=true;
{code}
Then the client-side code would take this into account and not call updateCache 
to verify if the table metadata has changed. The server-side code (in 
MetaDataEndPointImpl) would throw an exception if this property was true and an 
ALTER TABLE statement was done on the table. This really only makes sense to 
implement after we no longer need to ask the server for the current time (which 
is when we support transactions), as even if we don't need to validate the 
metadata is up-to-date, we still need to get the current server time.

Not sure I understand the "two extra RPCs" for select * from t where pk = ? We 
do one that both gets the current server time and verifies that the metadata 
for t is up-to-date (through a server-side cache). Are you seeing something 
different?


> Avoid retrieve metadata from server to gain performance
> -------------------------------------------------------
>
>                 Key: PHOENIX-1270
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1270
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>            Reporter: daniel meng
>         Attachments: PHOENIX-1270.patch
>
>
> Now the SELECT or UPSERT(when autoCommit is TRUE) will need one extra RPC for 
> retrieve metadata from RS. In some cases where metadata rarely changed and 
> higher TPS is required, we should let the client have a choice to use cache 
> directly for better performance. the attached patch do two :
> 1. enable metadata cache self refresh (switch by "phoenix.cache.autoRefresh")
> 2. client can use hint /\*+ALWAYS_USE_META_CACHE\*/ to force compiler to use 
> cache frist
> thanks in advance for your advice



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to