Tabnine Logo
ViewIndex.getQuery
Code IndexAdd Tabnine to your IDE (free)

How to use
getQuery
method
in
org.h2.index.ViewIndex

Best Java code snippets using org.h2.index.ViewIndex.getQuery (Showing top 20 results out of 315)

origin: com.h2database/h2

boolean initialize() {
  return collectJoinBatches(viewIndex.getQuery()) && joinBatches != null;
}
origin: apache/ignite

/**
 * @param f Table filter.
 * @return Sub-query.
 */
private static Query getSubQuery(TableFilter f) {
  return ((ViewIndex)f.getIndex()).getQuery();
}
origin: com.h2database/h2

columns = new Column[0];
if (!recursive) {
  query = getQuery(session, masks, filters, filter, sortOrder);
origin: com.h2database/h2

@Override
protected Cursor run() throws Exception {
  viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
  ArrayList<JoinBatch> joinBatches = batchUnion.joinBatches;
  for (int i = 0, size = joinBatches.size(); i < size; i++) {
    assert topFutureCursors[i] != null;
    joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i];
  }
  ResultInterface localResult;
  boolean lazy = false;
  try {
    localResult = viewIndex.getQuery().query(0);
    lazy = localResult.isLazy();
  } finally {
    if (!lazy) {
      resetViewTopFutureCursorAfterQuery();
    }
  }
  return newCursor(localResult);
}
origin: com.h2database/h2

@Override
protected Cursor run() throws Exception {
  if (topFutureCursor == null) {
    // if the top cursor is empty then the whole query will produce
    // empty result
    return EMPTY_CURSOR;
  }
  viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
  JoinBatch.this.viewTopFutureCursor = topFutureCursor;
  ResultInterface localResult;
  boolean lazy = false;
  try {
    localResult = viewIndex.getQuery().query(0);
    lazy = localResult.isLazy();
  } finally {
    if (!lazy) {
      resetViewTopFutureCursorAfterQuery();
    }
  }
  return newCursor(localResult);
}
origin: com.h2database/h2

/**
 * Create index lookup batch for a view index.
 *
 * @param viewIndex view index
 * @return index lookup batch or {@code null} if batching is not supported
 *         for this query
 */
public static IndexLookupBatch createViewIndexLookupBatch(ViewIndex viewIndex) {
  Query query = viewIndex.getQuery();
  if (query.isUnion()) {
    ViewIndexLookupBatchUnion unionBatch = new ViewIndexLookupBatchUnion(viewIndex);
    return unionBatch.initialize() ? unionBatch : null;
  }
  JoinBatch jb = ((Select) query).getJoinBatch();
  if (jb == null || jb.getLookupBatch(0) == null) {
    // our sub-query is not batched or is top batched sub-query
    return null;
  }
  assert !jb.batchedSubQuery;
  jb.batchedSubQuery = true;
  return jb.viewIndexLookupBatch(viewIndex);
}
origin: apache/ignite

/**
 * @param qry Query.
 */
private void collectOptimizedTableFiltersOrder(Query qry) {
  if (qry instanceof SelectUnion) {
    collectOptimizedTableFiltersOrder(((SelectUnion)qry).getLeft());
    collectOptimizedTableFiltersOrder(((SelectUnion)qry).getRight());
  }
  else {
    Select select = (Select)qry;
    TableFilter filter = select.getTopTableFilter();
    int i = 0;
    do {
      assert0(filter != null, select);
      assert0(filter.getNestedJoin() == null, select);
      // Here all the table filters must have generated unique aliases,
      // thus we can store them in the same map for all the subqueries.
      optimizedTableFilterOrder.put(filter.getTableAlias(), i++);
      Table tbl = filter.getTable();
      // Go down and collect inside of optimized subqueries.
      if (tbl instanceof TableView) {
        ViewIndex viewIdx = (ViewIndex)filter.getIndex();
        collectOptimizedTableFiltersOrder(viewIdx.getQuery());
      }
      filter = filter.getJoin();
    }
    while (filter != null);
  }
}
origin: com.h2database/h2

session.pushSubQueryInfo(masks, filters, filter, select.getSortOrder());
try {
  ((ViewIndex) index).getQuery().prepareJoinBatch();
} finally {
  session.popSubQueryInfo();
origin: org.apache.ignite/ignite-indexing

/**
 * @param f Table filter.
 * @return Sub-query.
 */
private static Query getSubQuery(TableFilter f) {
  return ((ViewIndex)f.getIndex()).getQuery();
}
origin: org.wowtools/h2

boolean initialize() {
  return collectJoinBatches(viewIndex.getQuery()) && joinBatches != null;
}
origin: com.eventsourcing/h2

boolean initialize() {
  return collectJoinBatches(viewIndex.getQuery()) && joinBatches != null;
}
origin: com.eventsourcing/h2

  @Override
  protected Cursor run() throws Exception {
    viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
    ArrayList<JoinBatch> joinBatches = batchUnion.joinBatches;
    for (int i = 0, size = joinBatches.size(); i < size; i++) {
      assert topFutureCursors[i] != null;
      joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i];
    }
    LocalResult localResult;
    try {
      localResult = viewIndex.getQuery().query(0);
    } finally {
      for (int i = 0, size = joinBatches.size(); i < size; i++) {
        joinBatches.get(i).viewTopFutureCursor = null;
      }
    }
    return newCursor(localResult);
  }
}
origin: org.wowtools/h2

  @Override
  protected Cursor run() throws Exception {
    viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
    ArrayList<JoinBatch> joinBatches = batchUnion.joinBatches;
    for (int i = 0, size = joinBatches.size(); i < size; i++) {
      assert topFutureCursors[i] != null;
      joinBatches.get(i).viewTopFutureCursor = topFutureCursors[i];
    }
    LocalResult localResult;
    try {
      localResult = viewIndex.getQuery().query(0);
    } finally {
      for (int i = 0, size = joinBatches.size(); i < size; i++) {
        joinBatches.get(i).viewTopFutureCursor = null;
      }
    }
    return newCursor(localResult);
  }
}
origin: com.h2database/com.springsource.org.h2

public ViewIndex(TableView view, ViewIndex index, Session session, int[] masks) throws SQLException {
  initBaseIndex(view, 0, null, null, IndexType.createNonUnique(false));
  this.querySQL = index.querySQL;
  this.originalParameters = index.originalParameters;
  this.recursive = index.recursive;
  this.masks = masks;
  this.session = session;
  columns = new Column[0];
  query = getQuery(session, masks);
  planSQL =  query.getPlanSQL();
}
origin: com.eventsourcing/h2

columns = new Column[0];
if (!recursive) {
  query = getQuery(session, masks, filters, filter, sortOrder);
origin: com.eventsourcing/h2

  @Override
  protected Cursor run() throws Exception {
    if (topFutureCursor == null) {
      // if the top cursor is empty then the whole query will produce
      // empty result
      return EMPTY_CURSOR;
    }
    viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
    JoinBatch.this.viewTopFutureCursor = topFutureCursor;
    LocalResult localResult;
    try {
      localResult = viewIndex.getQuery().query(0);
    } finally {
      JoinBatch.this.viewTopFutureCursor = null;
    }
    return newCursor(localResult);
  }
}
origin: org.wowtools/h2

  @Override
  protected Cursor run() throws Exception {
    if (topFutureCursor == null) {
      // if the top cursor is empty then the whole query will produce
      // empty result
      return EMPTY_CURSOR;
    }
    viewIndex.setupQueryParameters(viewIndex.getSession(), first, last, null);
    JoinBatch.this.viewTopFutureCursor = topFutureCursor;
    LocalResult localResult;
    try {
      localResult = viewIndex.getQuery().query(0);
    } finally {
      JoinBatch.this.viewTopFutureCursor = null;
    }
    return newCursor(localResult);
  }
}
origin: com.eventsourcing/h2

/**
 * Create index lookup batch for a view index.
 *
 * @param viewIndex view index
 * @return index lookup batch or {@code null} if batching is not supported
 *         for this query
 */
public static IndexLookupBatch createViewIndexLookupBatch(ViewIndex viewIndex) {
  Query query = viewIndex.getQuery();
  if (query.isUnion()) {
    ViewIndexLookupBatchUnion unionBatch = new ViewIndexLookupBatchUnion(viewIndex);
    return unionBatch.initialize() ? unionBatch : null;
  }
  JoinBatch jb = ((Select) query).getJoinBatch();
  if (jb == null || jb.getLookupBatch(0) == null) {
    // our sub-query is not batched or is top batched sub-query
    return null;
  }
  assert !jb.batchedSubQuery;
  jb.batchedSubQuery = true;
  return jb.viewIndexLookupBatch(viewIndex);
}
origin: org.wowtools/h2

/**
 * Create index lookup batch for a view index.
 *
 * @param viewIndex view index
 * @return index lookup batch or {@code null} if batching is not supported
 *         for this query
 */
public static IndexLookupBatch createViewIndexLookupBatch(ViewIndex viewIndex) {
  Query query = viewIndex.getQuery();
  if (query.isUnion()) {
    ViewIndexLookupBatchUnion unionBatch = new ViewIndexLookupBatchUnion(viewIndex);
    return unionBatch.initialize() ? unionBatch : null;
  }
  JoinBatch jb = ((Select) query).getJoinBatch();
  if (jb == null || jb.getLookupBatch(0) == null) {
    // our sub-query is not batched or is top batched sub-query
    return null;
  }
  assert !jb.batchedSubQuery;
  jb.batchedSubQuery = true;
  return jb.viewIndexLookupBatch(viewIndex);
}
origin: org.apache.ignite/ignite-indexing

/**
 * @param qry Query.
 */
private void collectOptimizedTableFiltersOrder(Query qry) {
  if (qry instanceof SelectUnion) {
    collectOptimizedTableFiltersOrder(((SelectUnion)qry).getLeft());
    collectOptimizedTableFiltersOrder(((SelectUnion)qry).getRight());
  }
  else {
    Select select = (Select)qry;
    TableFilter filter = select.getTopTableFilter();
    int i = 0;
    do {
      assert0(filter != null, select);
      assert0(filter.getNestedJoin() == null, select);
      // Here all the table filters must have generated unique aliases,
      // thus we can store them in the same map for all the subqueries.
      optimizedTableFilterOrder.put(filter.getTableAlias(), i++);
      Table tbl = filter.getTable();
      // Go down and collect inside of optimized subqueries.
      if (tbl instanceof TableView) {
        ViewIndex viewIdx = (ViewIndex)filter.getIndex();
        collectOptimizedTableFiltersOrder(viewIdx.getQuery());
      }
      filter = filter.getJoin();
    }
    while (filter != null);
  }
}
org.h2.indexViewIndexgetQuery

Popular methods of ViewIndex

  • <init>
    Constructor for plan item generation. Over this index the query will be executed.
  • getCost
  • getSession
  • initBaseIndex
  • setRecursive
  • compareRows
  • find
  • findRecursive
  • getTable
  • isExpired
  • isRecursive
  • prepareSubQuery
  • isRecursive,
  • prepareSubQuery,
  • setParameter,
  • setupQueryParameters

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Collectors (java.util.stream)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now