PostGIS  2.5.2dev-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 1003 of file gserialized_estimate.c.

References pg_get_nd_stats(), and text_to_cstring().

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

1004 {
1005  const char *att_name = text_to_cstring(att_text);
1006  AttrNumber att_num;
1007 
1008  /* We know the name? Look up the num */
1009  if ( att_text )
1010  {
1011  /* Get the attribute number */
1012  att_num = get_attnum(table_oid, att_name);
1013  if ( ! att_num ) {
1014  elog(ERROR, "attribute \"%s\" does not exist", att_name);
1015  return NULL;
1016  }
1017  }
1018  else
1019  {
1020  elog(ERROR, "attribute name is null");
1021  return NULL;
1022  }
1023 
1024  return pg_get_nd_stats(table_oid, att_num, mode, only_parent);
1025 }
char * text_to_cstring(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: