2094 Oid table_oid1 = PG_GETARG_OID(0);
2095 text *att_text1 = PG_GETARG_TEXT_P(1);
2096 Oid table_oid2 = PG_GETARG_OID(2);
2097 text *att_text2 = PG_GETARG_TEXT_P(3);
2099 float8 selectivity = 0;
2108 elog(ERROR,
"stats for \"%s.%s\" do not exist", get_rel_name(table_oid1),
text2cstring(att_text1));
2111 elog(ERROR,
"stats for \"%s.%s\" do not exist", get_rel_name(table_oid2),
text2cstring(att_text2));
2114 if ( ! PG_ARGISNULL(4) )
2116 text *modetxt = PG_GETARG_TEXT_P(4);
2118 if ( modestr[0] ==
'N' )
2127 PG_RETURN_FLOAT8(selectivity);
static ND_STATS * pg_get_nd_stats_by_name(const Oid table_oid, const text *att_text, int mode, bool only_parent)
Pull the stats object from the PgSQL system catalogs.
char * text2cstring(const text *textptr)
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.