1274 Node *arg1 = (Node*) linitial(
args);
1275 Node *arg2 = (Node*) lsecond(
args);
1276 Var *var1 = (Var*) arg1;
1277 Var *var2 = (Var*) arg2;
1279 POSTGIS_DEBUGF(2,
"%s: entered function", __func__);
1283 if (!IsA(arg1, Var) || !IsA(arg2, Var))
1285 POSTGIS_DEBUGF(1,
"%s called with arguments that are not column references", __func__);
1290 relid1 = rt_fetch(var1->varno, root->parse->rtable)->relid;
1291 relid2 = rt_fetch(var2->varno, root->parse->rtable)->relid;
1300 POSTGIS_DEBUGF(2,
"%s: cannot find stats for \"%s\"", __func__, get_rel_name(relid2) ? get_rel_name(relid2) :
"NULL");
1305 POSTGIS_DEBUGF(2,
"%s: cannot find stats for \"%s\"", __func__, get_rel_name(relid2) ? get_rel_name(relid2) :
"NULL");
1310 POSTGIS_DEBUGF(2,
"got selectivity %g", selectivity);
static ND_STATS * pg_get_nd_stats(const Oid table_oid, AttrNumber att_num, int mode, bool only_parent)
Pull the stats object from the PgSQL system catalogs.
#define DEFAULT_ND_JOINSEL
static float8 estimate_join_selectivity(const ND_STATS *s1, const ND_STATS *s2)
Given two statistics histograms, what is the selectivity of a join driven by the && or &&& operator?
N-dimensional statistics structure.