diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-12-03 17:45:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-12-03 17:45:38 +0000 |
commit | b255350864ec215b96de604af57fd984a09f4b3a (patch) | |
tree | 82514b0a943c0477fd728eaa620e1b6f8aa403d6 /src/backend/utils/cache | |
parent | be5a80739b735257a9738f4d12781345da1f4050 (diff) | |
download | postgresql-b255350864ec215b96de604af57fd984a09f4b3a.tar.gz postgresql-b255350864ec215b96de604af57fd984a09f4b3a.zip |
Planner failed to be smart about binary-compatible expressions in pathkeys
and hash bucket-size estimation. Issue has been there awhile but is more
critical in 7.4 because it affects varchar columns. Per report from
Greg Stark.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 992be3ca4e3..3543ac0edcb 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.108 2003/10/04 18:22:59 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.108.2.1 2003/12/03 17:45:37 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -465,6 +465,29 @@ get_opname(Oid opno) } /* + * op_input_types + * + * Returns the left and right input datatypes for an operator + * (InvalidOid if not relevant). + */ +void +op_input_types(Oid opno, Oid *lefttype, Oid *righttype) +{ + HeapTuple tp; + Form_pg_operator optup; + + tp = SearchSysCache(OPEROID, + ObjectIdGetDatum(opno), + 0, 0, 0); + if (!HeapTupleIsValid(tp)) /* shouldn't happen */ + elog(ERROR, "cache lookup failed for operator %u", opno); + optup = (Form_pg_operator) GETSTRUCT(tp); + *lefttype = optup->oprleft; + *righttype = optup->oprright; + ReleaseSysCache(tp); +} + +/* * op_mergejoinable * * Returns the left and right sort operators corresponding to a |