for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) { byte[] cf = where.getFirst(); if (cf != null) { byte[] cf = null; if ( !table.getColumnFamilies().isEmpty() && !whereConditions.isEmpty() ) { for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) { byte[] whereCF = where.getFirst(); if (Bytes.compareTo(defaultCF, whereCF) == 0) { cf = context.getWhereConditionColumns().get(0).getFirst();
if (EncodedColumnsUtil.useEncodedQualifierListOptimization(table, scan)) { Pair<Integer, Integer> minMaxQualifiers = new Pair<>(); for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] cq = whereCol.getSecond(); if (cq != null) {
BitSet trackedColumnsBitset = isPossibleToUseEncodedCQFilter(encodingScheme, storageScheme) && !hasDynamicColumns(table) ? new BitSet(10) : null; boolean filteredColumnNotInProjection = false; for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] filteredFamily = whereCol.getFirst(); if (!(familyMap.containsKey(filteredFamily))) { for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] family = whereCol.getFirst(); if (preventSeekToColumn) {
RowProjector projector = plan.getProjector(); boolean optimizeProjection = false; boolean keyOnlyFilter = familyMap.isEmpty() && context.getWhereConditionColumns().isEmpty(); if (!projector.projectEverything()) { context.getWhereConditionColumns().clear(); for (PColumnFamily family : table.getColumnFamilies()) { context.addWhereConditionColumn(family.getName().getBytes(), null);
for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) { byte[] cf = where.getFirst(); if (cf != null) { byte[] cf = null; if ( !table.getColumnFamilies().isEmpty() && !whereConditions.isEmpty() ) { for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) { byte[] whereCF = where.getFirst(); if (Bytes.compareTo(defaultCF, whereCF) == 0) { cf = context.getWhereConditionColumns().get(0).getFirst();
for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) { byte[] cf = where.getFirst(); if (cf != null) { byte[] cf = null; if ( !table.getColumnFamilies().isEmpty() && !whereConditions.isEmpty() ) { for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) { byte[] whereCF = where.getFirst(); if (Bytes.compareTo(defaultCF, whereCF) == 0) { cf = context.getWhereConditionColumns().get(0).getFirst();
BitSet trackedColumnsBitset = isPossibleToUseEncodedCQFilter(encodingScheme, storageScheme) && !hasDynamicColumns(table) ? new BitSet(10) : null; boolean filteredColumnNotInProjection = false; for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] filteredFamily = whereCol.getFirst(); if (!(familyMap.containsKey(filteredFamily))) { for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] family = whereCol.getFirst(); if (preventSeekToColumn) {
if (EncodedColumnsUtil.useEncodedQualifierListOptimization(table, scan)) { Pair<Integer, Integer> minMaxQualifiers = new Pair<>(); for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] cq = whereCol.getSecond(); if (cq != null) {
BitSet trackedColumnsBitset = isPossibleToUseEncodedCQFilter(encodingScheme, storageScheme) && !hasDynamicColumns(table) ? new BitSet(10) : null; boolean filteredColumnNotInProjection = false; for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] filteredFamily = whereCol.getFirst(); if (!(familyMap.containsKey(filteredFamily))) { for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] family = whereCol.getFirst(); if (preventSeekToColumn) {
if (EncodedColumnsUtil.useEncodedQualifierListOptimization(table, scan)) { Pair<Integer, Integer> minMaxQualifiers = new Pair<>(); for (Pair<byte[], byte[]> whereCol : context.getWhereConditionColumns()) { byte[] cq = whereCol.getSecond(); if (cq != null) {
private static void forceIndexCheck(QueryPlan plan) throws SQLException { PhoenixStatement statement = plan.getContext().getStatement(); ReadOnlyProps props = statement.getConnection().getQueryServices().getProps(); StatementContext context = plan.getContext(); if (plan.getProjector() == EXPLAIN_PLAN_ROW_PROJECTOR_WITH_BYTE_ROW_ESTIMATES || context.getWhereConditionColumns().isEmpty() || !props.getBoolean(PHOENIX_FORCE_INDEX, DEFAULT_PHOENIX_FORCE_INDEX)) { return; } SelectStatement select = (SelectStatement) plan.getStatement(); if (!select.getHint().hasHint(Hint.NO_INDEX) && !select.isJoin() && !select.isUnion() && context.getFilterConditionsPKColumns().isEmpty()) { PTable table = plan.getTableRef().getTable(); String schema = table.getSchemaName() == null ? null : table.getSchemaName().getString(); throw new ForceIndexException(schema, table.getTableName().toString(), "The filters must contain at least one index column."); } }
context1.getWhereConditionColumns().isEmpty() && context2.getWhereConditionColumns().isEmpty() && !context1.getFilterConditionsPKColumns().isEmpty() && !context2.getFilterConditionsPKColumns().isEmpty()) { c = getBetterCandidate(table1.getPKColumns(), context1.getFilterConditionsPKColumns(),
RowProjector projector = plan.getProjector(); boolean optimizeProjection = false; boolean keyOnlyFilter = familyMap.isEmpty() && context.getWhereConditionColumns().isEmpty(); if (!projector.projectEverything()) { context.getWhereConditionColumns().clear(); for (PColumnFamily family : table.getColumnFamilies()) { context.addWhereConditionColumn(family.getName().getBytes(), null);
RowProjector projector = plan.getProjector(); boolean optimizeProjection = false; boolean keyOnlyFilter = familyMap.isEmpty() && context.getWhereConditionColumns().isEmpty(); if (!projector.projectEverything()) { context.getWhereConditionColumns().clear(); for (PColumnFamily family : table.getColumnFamilies()) { context.addWhereConditionColumn(family.getName().getBytes(), null);
List<Pair<byte[], byte[]>> commonConditionColumns = dataPlan.getContext().getWhereConditionColumns(); IndexMaintainer maintainer = index.getIndexMaintainer(dataTable, statement.getConnection()); for (Pair<byte[], byte[]> pair : commonConditionColumns) {