/** * Get the estimated average rowsize. DO NOT call this API directly. * Call the stats API instead which modifies the counts based on preference options. * @param index, to use for generating the estimate * @return row count post filtering */ public MapRDBStatisticsPayload getAverageRowSizeStats(IndexDescriptor index) { IndexDesc indexDesc = null; double avgRowSize = AVG_ROWSIZE_UNKNOWN; if (index != null) { indexDesc = (IndexDesc)((MapRDBIndexDescriptor)index).getOriginalDesc(); } // If no index is specified, get it from the primary table if (indexDesc == null && scanSpec.isSecondaryIndex()) { throw new UnsupportedOperationException("getAverageRowSizeStats should be invoked on primary table"); } // Get the index table or primary table and use the DB API to get the estimated number of rows. For size estimates, // we assume that all the columns would be read from the disk. final Table table = this.formatPlugin.getJsonTableCache().getTable(scanSpec.getTableName(), indexDesc, getUserName()); if (table != null) { final MetaTable metaTable = table.getMetaTable(); if (metaTable != null) { avgRowSize = metaTable.getAverageRowSize(); } } logger.debug("index_plan_info: getEstimatedRowCount obtained from DB Client for {}: indexName: {}, indexInfo: {}, " + "avgRowSize: {}, estimatedSize {}", this, (indexDesc == null ? "null" : indexDesc.getIndexName()), (indexDesc == null ? "null" : indexDesc.getIndexInfo()), avgRowSize); return new MapRDBStatisticsPayload(ROWCOUNT_UNKNOWN, ROWCOUNT_UNKNOWN, avgRowSize); }
"condition: {} rowCount: {}, avgRowSize: {}, estimatedSize {}, tabletCount {}, totalTabletCount {}, " + "scalingFactor {}", this, (index == null ? "null" : index.getIndexName()), (index == null ? "null" : index.getIndexInfo()), (condition == null ? "null" : condition.toString()), stats.getEstimatedNumRows(), (stats.getEstimatedNumRows() == 0 ? 0 : stats.getEstimatedSize()/stats.getEstimatedNumRows()), logger.info("index_plan_info: getEstimatedRowCount: {} indexName: {}, indexInfo: {}, " + "condition: {} rowCount: UNKNOWN, avgRowSize: UNKNOWN", this, (index == null ? "null" : index.getIndexName()), (index == null ? "null" : index.getIndexInfo()), (condition == null ? "null" : condition.toString())); return new MapRDBStatisticsPayload(ROWCOUNT_UNKNOWN, ROWCOUNT_UNKNOWN, AVG_ROWSIZE_UNKNOWN);
/** * Get the estimated average rowsize. DO NOT call this API directly. * Call the stats API instead which modifies the counts based on preference options. * @param index, to use for generating the estimate * @return row count post filtering */ public MapRDBStatisticsPayload getAverageRowSizeStats(IndexDescriptor index) { IndexDesc indexDesc = null; double avgRowSize = AVG_ROWSIZE_UNKNOWN; if (index != null) { indexDesc = (IndexDesc)((MapRDBIndexDescriptor)index).getOriginalDesc(); } // If no index is specified, get it from the primary table if (indexDesc == null && scanSpec.isSecondaryIndex()) { throw new UnsupportedOperationException("getAverageRowSizeStats should be invoked on primary table"); } // Get the index table or primary table and use the DB API to get the estimated number of rows. For size estimates, // we assume that all the columns would be read from the disk. final Table table = this.formatPlugin.getJsonTableCache().getTable(scanSpec.getTableName(), indexDesc, getUserName()); if (table != null) { final MetaTable metaTable = table.getMetaTable(); if (metaTable != null) { avgRowSize = metaTable.getAverageRowSize(); } } logger.debug("index_plan_info: getEstimatedRowCount obtained from DB Client for {}: indexName: {}, indexInfo: {}, " + "avgRowSize: {}, estimatedSize {}", this, (indexDesc == null ? "null" : indexDesc.getIndexName()), (indexDesc == null ? "null" : indexDesc.getIndexInfo()), avgRowSize); return new MapRDBStatisticsPayload(ROWCOUNT_UNKNOWN, ROWCOUNT_UNKNOWN, avgRowSize); }
"condition: {} rowCount: {}, avgRowSize: {}, estimatedSize {}, tabletCount {}, totalTabletCount {}, " + "scalingFactor {}", this, (index == null ? "null" : index.getIndexName()), (index == null ? "null" : index.getIndexInfo()), (condition == null ? "null" : condition.toString()), stats.getEstimatedNumRows(), (stats.getEstimatedNumRows() == 0 ? 0 : stats.getEstimatedSize()/stats.getEstimatedNumRows()), logger.info("index_plan_info: getEstimatedRowCount: {} indexName: {}, indexInfo: {}, " + "condition: {} rowCount: UNKNOWN, avgRowSize: UNKNOWN", this, (index == null ? "null" : index.getIndexName()), (index == null ? "null" : index.getIndexInfo()), (condition == null ? "null" : condition.toString())); return new MapRDBStatisticsPayload(ROWCOUNT_UNKNOWN, ROWCOUNT_UNKNOWN, AVG_ROWSIZE_UNKNOWN);