summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-10-11 17:27:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-10-11 17:27:14 +0000
commit0cc0d0822ddf8e76ed3b7d16ad500762b2ed43dd (patch)
tree77705c6620adbec650660defb4ad56eb65ceeb47 /src/backend/utils/adt/selfuncs.c
parent07e6f93d6b41aaacaf5d2bf758f52ef37f0a6e5b (diff)
Document that get_attstatsslot/free_attstatsslot only need to be passed
valid type information if they are asked to fetch the values part of a pg_statistic slot; these arguments are unneeded if fetching only the numbers part. Use this to save a catcache lookup in btcostestimate, which is looking like a bit of a hotspot in recent profiling. Not a big savings, but since it's essentially free, might as well do it.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r--src/backend/utils/adt/selfuncs.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index e987a66a1cf..ccc8d0f4483 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.189 2005/09/24 22:54:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.190 2005/10/11 17:27:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4466,15 +4466,10 @@ btcostestimate(PG_FUNCTION_ARGS)
if (HeapTupleIsValid(tuple))
{
- Oid typid;
- int32 typmod;
float4 *numbers;
int nnumbers;
- /* XXX this code would break with different storage type */
- get_atttypetypmod(relid, colnum, &typid, &typmod);
-
- if (get_attstatsslot(tuple, typid, typmod,
+ if (get_attstatsslot(tuple, InvalidOid, 0,
STATISTIC_KIND_CORRELATION,
index->ordering[0],
NULL, NULL, &numbers, &nnumbers))
@@ -4489,7 +4484,7 @@ btcostestimate(PG_FUNCTION_ARGS)
else
*indexCorrelation = varCorrelation;
- free_attstatsslot(typid, NULL, 0, numbers, nnumbers);
+ free_attstatsslot(InvalidOid, NULL, 0, numbers, nnumbers);
}
ReleaseSysCache(tuple);
}