MISSING CASE?  if (where == null) { matviewinfo.setPredicate(""); } -- in case someone ever does a full cross-join with no filters.