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

James Taylor commented on PHOENIX-1328:
---------------------------------------

First pass it's fine if you just collect the stats for the table and/or indexes 
serially in MetaDataClient. Just loop over the indexes after you've resolved 
the table. like this:
{code}
    public MutationState updateStatistics(UpdateStatisticsStatement 
updateStatisticsStmt) throws SQLException {
        // Check before updating the stats if we have reached the configured 
time to reupdate the stats once again
        long msMinBetweenUpdates = connection.getQueryServices().getProps()
                .getLong(QueryServices.MIN_STATS_UPDATE_FREQ_MS_ATTRIB, 
QueryServicesOptions.DEFAULT_MIN_STATS_UPDATE_FREQ_MS);
        ColumnResolver resolver = 
FromCompiler.getResolver(updateStatisticsStmt, connection);
        PTable table = resolver.getTables().get(0).getTable();
        if (updateStatisticsStmt.updateColumns()) {
            doUpdateStatistics(table);
        }
        if (updateStatisticsStmt.updateIndexes()) {
            for (PTable index : table.getIndexes()) {
                doUpdateStatistics(index);
            }
        }
}

private void doUpdateStatistics(PTable table) {
    // TODO: refactored code here
}
{code}

> Update ANALYZE syntax to collect stats on index tables and all tables
> ---------------------------------------------------------------------
>
>                 Key: PHOENIX-1328
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1328
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>
> Based on the discussion in PHOENIX-1309 we will now modify the ANALYZE query 
> to collect the stats for index table and all the tables associated with the 
> main table (includes index).



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

Reply via email to