PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ pg_get_nd_stats_by_name()

static ND_STATS* pg_get_nd_stats_by_name ( const Oid  table_oid,
const text *  att_text,
int  mode,
bool  only_parent 
)
static

Pull the stats object from the PgSQL system catalogs.

The debugging functions are taking human input (table names) and columns, so we have to look those up first. In case of parent tables whith INHERITS, when "only_parent" is TRUE this function only searchs for stats in the parent table ignoring any statistic collected from the children.

Definition at line 959 of file gserialized_estimate.c.

References pg_get_nd_stats(), and text2cstring().

Referenced by _postgis_gserialized_joinsel(), _postgis_gserialized_sel(), _postgis_gserialized_stats(), and gserialized_estimated_extent().

960 {
961  const char *att_name = text2cstring(att_text);
962  AttrNumber att_num;
963 
964  /* We know the name? Look up the num */
965  if ( att_text )
966  {
967  /* Get the attribute number */
968  att_num = get_attnum(table_oid, att_name);
969  if ( ! att_num ) {
970  elog(ERROR, "attribute \"%s\" does not exist", att_name);
971  return NULL;
972  }
973  }
974  else
975  {
976  elog(ERROR, "attribute name is null");
977  return NULL;
978  }
979 
980  return pg_get_nd_stats(table_oid, att_num, mode, only_parent);
981 }
char * text2cstring(const text *textptr)
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.
Here is the call graph for this function:
Here is the caller graph for this function: