|
|
@ -15,7 +15,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
* IDENTIFICATION |
|
|
|
* IDENTIFICATION |
|
|
|
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.245 2008/03/09 00:32:09 tgl Exp $ |
|
|
|
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.246 2008/03/17 17:13:54 tgl Exp $ |
|
|
|
* |
|
|
|
* |
|
|
|
*------------------------------------------------------------------------- |
|
|
|
*------------------------------------------------------------------------- |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -4531,17 +4531,17 @@ prefix_selectivity(VariableStatData *vardata, |
|
|
|
* "x < greaterstr". |
|
|
|
* "x < greaterstr". |
|
|
|
*------- |
|
|
|
*------- |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
cmpopr = get_opfamily_member(opfamily, vartype, vartype, |
|
|
|
|
|
|
|
BTLessStrategyNumber); |
|
|
|
|
|
|
|
if (cmpopr == InvalidOid) |
|
|
|
|
|
|
|
elog(ERROR, "no < operator for opfamily %u", opfamily); |
|
|
|
|
|
|
|
fmgr_info(get_opcode(cmpopr), &opproc); |
|
|
|
|
|
|
|
|
|
|
|
greaterstrcon = make_greater_string(prefixcon, &opproc); |
|
|
|
greaterstrcon = make_greater_string(prefixcon, &opproc); |
|
|
|
if (greaterstrcon) |
|
|
|
if (greaterstrcon) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Selectivity topsel; |
|
|
|
Selectivity topsel; |
|
|
|
|
|
|
|
|
|
|
|
cmpopr = get_opfamily_member(opfamily, vartype, vartype, |
|
|
|
|
|
|
|
BTLessStrategyNumber); |
|
|
|
|
|
|
|
if (cmpopr == InvalidOid) |
|
|
|
|
|
|
|
elog(ERROR, "no < operator for opfamily %u", opfamily); |
|
|
|
|
|
|
|
fmgr_info(get_opcode(cmpopr), &opproc); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
topsel = ineq_histogram_selectivity(vardata, &opproc, false, |
|
|
|
topsel = ineq_histogram_selectivity(vardata, &opproc, false, |
|
|
|
greaterstrcon->constvalue, |
|
|
|
greaterstrcon->constvalue, |
|
|
|
greaterstrcon->consttype); |
|
|
|
greaterstrcon->consttype); |
|
|
|