Exemplo n.º 1
0
// is this entire expression cacheable after this phase?
NABoolean Scan::isCacheableExpr(CacheWA& cwa)
{
  if (cwa.getPhase() >= CmpMain::BIND) {
    // save scan's TableDesc
    cwa.incNofScans(tabId_);

    // native hbase access is not cacheable for now.
    if ((getTableDesc()->getNATable()->isHbaseRowTable()) ||
	(getTableDesc()->getNATable()->isHbaseCellTable()))
      return FALSE;

    if (stream_) { // pub-sub streams are not cacheable
      return FALSE;
    }
    // mpalias SELECT is not cacheable unless explicitly requested
    if (getTableDesc()->getNATable()->isAnMPTableWithAnsiName() &&
        CmpCommon::getDefault(QUERY_CACHE_MPALIAS) == DF_OFF) {
      return FALSE;
    }
    cwa.setConditionallyCacheable(); 
    if (CmpCommon::getDefaultLong(MVQR_REWRITE_LEVEL) >= 1 &&
        QRDescGenerator::hasRewriteEnabledMVs(getTableDesc())) {
      cwa.setRewriteEnabledMV();
    }
    return RelExpr::isCacheableExpr(cwa);
  }
  return FALSE;
}