public void processMaterializedViewWarnings ( Database db , HashMap < Table , String > matViewMap ) throws VoltCompilerException { for ( Table table : db . getTables ( ) ) { for ( MaterializedViewInfo mvInfo : table . getViews ( ) ) { for ( Statement stmt : mvInfo . getFallbackquerystmts ( ) ) { // If there is any statement in the fallBackQueryStmts map, then // there must be some min/max columns. // Only check if the plan uses index scan. if ( needsWarningForSingleTableView ( getPlanNodeTreeFromCatalogStatement ( db , stmt ) ) ) { // If we are using IS NOT DISTINCT FROM as our equality operator (which is necessary // to get correct answers), then there will often be no index scans in the plan, // since we cannot optimize IS NOT DISTINCT FROM. m_compiler . addWarn ( "No index found to support UPDATE and DELETE on some of the min() / max() columns " + "in the materialized view " + mvInfo . getTypeName ( ) + ", and a sequential scan might be issued when current min / max value is updated / deleted." ) ; break ; } } } // If it's a view on join query case, we check if the join can utilize indices. // We throw out warning only if no index scan is used in the plan (ENG-10864). MaterializedViewHandlerInfo mvHandlerInfo = table . getMvhandlerinfo ( ) . get ( "mvHandlerInfo" ) ; if ( mvHandlerInfo != null ) { Statement createQueryStatement = mvHandlerInfo . getCreatequery ( ) . get ( "createQuery" ) ; if ( needsWarningForJoinQueryView ( getPlanNodeTreeFromCatalogStatement ( db , createQueryStatement ) ) ) { m_compiler . addWarn ( "No index found to support some of the join operations required to refresh the materialized view " + table . getTypeName ( ) + ". The refreshing may be slow." ) ; } } } }
Process materialized view warnings .