@Override public int getFetchSize() throws SQLException { return statement.getFetchSize(); }
private int getScannerCacheSize() { try { return plan.getContext().getStatement().getFetchSize(); } catch (Throwable e) { Throwables.propagate(e); } return -1; // unreachable }
/** * Selecting underlying scanners in a round-robin fashion is possible if there is no ordering of * rows needed, not even row key order. Also no point doing round robin of scanners if fetch * size is 1. */ public static boolean isRoundRobinPossible(OrderBy orderBy, StatementContext context) throws SQLException { int fetchSize = context.getStatement().getFetchSize(); return fetchSize > 1 && !shouldRowsBeInRowKeyOrder(orderBy, context) && orderBy.getOrderByExpressions().isEmpty(); }
@Override public int getFetchSize() throws SQLException { return statement.getFetchSize(); }
@Override public int getFetchSize() throws SQLException { return statement.getFetchSize(); }
public QueryCompiler(PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory, SequenceManager sequenceManager, boolean projectTuples, boolean optimizeSubquery, Map<TableRef, QueryPlan> dataPlans) throws SQLException { this.statement = statement; this.select = select; this.resolver = resolver; this.scan = new Scan(); this.targetColumns = targetColumns; this.parallelIteratorFactory = parallelIteratorFactory; this.sequenceManager = sequenceManager; this.projectTuples = projectTuples; this.noChildParentJoinOptimization = select.getHint().hasHint(Hint.NO_CHILD_PARENT_JOIN_OPTIMIZATION) || select.getHint().hasHint(Hint.USE_PERSISTENT_CACHE); this.usePersistentCache = select.getHint().hasHint(Hint.USE_PERSISTENT_CACHE); ConnectionQueryServices services = statement.getConnection().getQueryServices(); this.costBased = services.getProps().getBoolean(QueryServices.COST_BASED_OPTIMIZER_ENABLED, QueryServicesOptions.DEFAULT_COST_BASED_OPTIMIZER_ENABLED); scan.setLoadColumnFamiliesOnDemand(true); if (select.getHint().hasHint(Hint.NO_CACHE)) { scan.setCacheBlocks(false); } scan.setCaching(statement.getFetchSize()); this.originalScan = ScanUtil.newScan(scan); this.optimizeSubquery = optimizeSubquery; this.dataPlans = dataPlans == null ? Collections.<TableRef, QueryPlan>emptyMap() : dataPlans; }
private int getScannerCacheSize() { try { return plan.getContext().getStatement().getFetchSize(); } catch (Throwable e) { Throwables.propagate(e); } return -1; // unreachable }
private int getScannerCacheSize() { try { return plan.getContext().getStatement().getFetchSize(); } catch (Throwable e) { Throwables.propagate(e); } return -1; // unreachable }
/** * Selecting underlying scanners in a round-robin fashion is possible if there is no ordering of * rows needed, not even row key order. Also no point doing round robin of scanners if fetch * size is 1. */ public static boolean isRoundRobinPossible(OrderBy orderBy, StatementContext context) throws SQLException { int fetchSize = context.getStatement().getFetchSize(); return fetchSize > 1 && !shouldRowsBeInRowKeyOrder(orderBy, context) && orderBy.getOrderByExpressions().isEmpty(); }
int scannerCacheSize = context.getStatement().getFetchSize(); if (limit != null && limit % scannerCacheSize == 0) { scan.setCaching(scannerCacheSize + 1);
/** * Selecting underlying scanners in a round-robin fashion is possible if there is no ordering of * rows needed, not even row key order. Also no point doing round robin of scanners if fetch * size is 1. */ public static boolean isRoundRobinPossible(OrderBy orderBy, StatementContext context) throws SQLException { int fetchSize = context.getStatement().getFetchSize(); return fetchSize > 1 && !shouldRowsBeInRowKeyOrder(orderBy, context) && orderBy.getOrderByExpressions().isEmpty(); }
public QueryCompiler(PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory, SequenceManager sequenceManager, boolean projectTuples, boolean optimizeSubquery, Map<TableRef, QueryPlan> dataPlans) throws SQLException { this.statement = statement; this.select = select; this.resolver = resolver; this.scan = new Scan(); this.targetColumns = targetColumns; this.parallelIteratorFactory = parallelIteratorFactory; this.sequenceManager = sequenceManager; this.projectTuples = projectTuples; this.noChildParentJoinOptimization = select.getHint().hasHint(Hint.NO_CHILD_PARENT_JOIN_OPTIMIZATION); ConnectionQueryServices services = statement.getConnection().getQueryServices(); this.costBased = services.getProps().getBoolean(QueryServices.COST_BASED_OPTIMIZER_ENABLED, QueryServicesOptions.DEFAULT_COST_BASED_OPTIMIZER_ENABLED); scan.setLoadColumnFamiliesOnDemand(true); if (select.getHint().hasHint(Hint.NO_CACHE)) { scan.setCacheBlocks(false); } scan.setCaching(statement.getFetchSize()); this.originalScan = ScanUtil.newScan(scan); this.optimizeSubquery = optimizeSubquery; this.dataPlans = dataPlans == null ? Collections.<TableRef, QueryPlan>emptyMap() : dataPlans; }
public QueryCompiler(PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory, SequenceManager sequenceManager, boolean projectTuples, boolean optimizeSubquery, Map<TableRef, QueryPlan> dataPlans) throws SQLException { this.statement = statement; this.select = select; this.resolver = resolver; this.scan = new Scan(); this.targetColumns = targetColumns; this.parallelIteratorFactory = parallelIteratorFactory; this.sequenceManager = sequenceManager; this.projectTuples = projectTuples; this.noChildParentJoinOptimization = select.getHint().hasHint(Hint.NO_CHILD_PARENT_JOIN_OPTIMIZATION) || select.getHint().hasHint(Hint.USE_PERSISTENT_CACHE); this.usePersistentCache = select.getHint().hasHint(Hint.USE_PERSISTENT_CACHE); ConnectionQueryServices services = statement.getConnection().getQueryServices(); this.costBased = services.getProps().getBoolean(QueryServices.COST_BASED_OPTIMIZER_ENABLED, QueryServicesOptions.DEFAULT_COST_BASED_OPTIMIZER_ENABLED); scan.setLoadColumnFamiliesOnDemand(true); if (select.getHint().hasHint(Hint.NO_CACHE)) { scan.setCacheBlocks(false); } scan.setCaching(statement.getFetchSize()); this.originalScan = ScanUtil.newScan(scan); this.optimizeSubquery = optimizeSubquery; this.dataPlans = dataPlans == null ? Collections.<TableRef, QueryPlan>emptyMap() : dataPlans; }
int scannerCacheSize = context.getStatement().getFetchSize(); if (limit != null && limit % scannerCacheSize == 0) { scan.setCaching(scannerCacheSize + 1);
int scannerCacheSize = context.getStatement().getFetchSize(); if (limit != null && limit % scannerCacheSize == 0) { scan.setCaching(scannerCacheSize + 1);