void analyzeTablePartitioning ( Collection < StmtTableScan > collection ) throws PlanningErrorException { m_countOfPartitionedTables = 0 ; // Do we have a need for a distributed scan at all? // Iterate over the tables to collect partition columns. for ( StmtTableScan tableScan : collection ) { if ( ! tableScan . getIsReplicated ( ) ) { ++ m_countOfPartitionedTables ; } } // Initial guess -- as if no equality filters. m_countOfIndependentlyPartitionedTables = m_countOfPartitionedTables ; }
This simple analysis counts the number of partitioned tables in the join tree of a query and initializes a guess for the count of independently partitioned tables .