geo_selfuncs.c
来自「postgresql8.3.4源码,开源数据库」· C语言 代码 · 共 96 行
C
96 行
/*------------------------------------------------------------------------- * * geo_selfuncs.c * Selectivity routines registered in the operator catalog in the * "oprrest" and "oprjoin" attributes. * * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $PostgreSQL: pgsql/src/backend/utils/adt/geo_selfuncs.c,v 1.31 2008/01/01 19:45:52 momjian Exp $ * * XXX These are totally bogus. Perhaps someone will make them do * something reasonable, someday. * *------------------------------------------------------------------------- */#include "postgres.h"#include "utils/geo_decls.h"/* * Selectivity functions for geometric operators. These are bogus -- unless * we know the actual key distribution in the index, we can't make a good * prediction of the selectivity of these operators. * * Note: the values used here may look unreasonably small. Perhaps they * are. For now, we want to make sure that the optimizer will make use * of a geometric index if one is available, so the selectivity had better * be fairly small. * * In general, GiST needs to search multiple subtrees in order to guarantee * that all occurrences of the same key have been found. Because of this, * the estimated cost for scanning the index ought to be higher than the * output selectivity would indicate. gistcostestimate(), over in selfuncs.c, * ought to be adjusted accordingly --- but until we can generate somewhat * realistic numbers here, it hardly matters... *//* * Selectivity for operators that depend on area, such as "overlap". */Datumareasel(PG_FUNCTION_ARGS){ PG_RETURN_FLOAT8(0.005);}Datumareajoinsel(PG_FUNCTION_ARGS){ PG_RETURN_FLOAT8(0.005);}/* * positionsel * * How likely is a box to be strictly left of (right of, above, below) * a given box? */Datumpositionsel(PG_FUNCTION_ARGS){ PG_RETURN_FLOAT8(0.1);}Datumpositionjoinsel(PG_FUNCTION_ARGS){ PG_RETURN_FLOAT8(0.1);}/* * contsel -- How likely is a box to contain (be contained by) a given box? * * This is a tighter constraint than "overlap", so produce a smaller * estimate than areasel does. */Datumcontsel(PG_FUNCTION_ARGS){ PG_RETURN_FLOAT8(0.001);}Datumcontjoinsel(PG_FUNCTION_ARGS){ PG_RETURN_FLOAT8(0.001);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?