mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Restore foreign-key-aware estimation of join relation sizes.
This patch provides a new implementation of the logic added by commit137805f89
and later removed by77ba61080
. It differs from the original primarily in expending much less effort per joinrel in large queries, which it accomplishes by doing most of the matching work once per query not once per joinrel. Hopefully, it's also less buggy and better commented. The never-documented enable_fkey_estimates GUC remains gone. There remains work to be done to make the selectivity estimates account for nulls in FK referencing columns; but that was true of the original patch as well. We may be able to address this point later in beta. In the meantime, any error should be in the direction of overestimating rather than underestimating joinrel sizes, which seems like the direction we want to err in. Tomas Vondra and Tom Lane Discussion: <31041.1465069446@sss.pgh.pa.us>
This commit is contained in:
@ -223,6 +223,7 @@ typedef enum NodeTag
|
||||
T_PlannerGlobal,
|
||||
T_RelOptInfo,
|
||||
T_IndexOptInfo,
|
||||
T_ForeignKeyOptInfo,
|
||||
T_ParamPathInfo,
|
||||
T_Path,
|
||||
T_IndexPath,
|
||||
@ -478,7 +479,8 @@ typedef enum NodeTag
|
||||
T_InlineCodeBlock, /* in nodes/parsenodes.h */
|
||||
T_FdwRoutine, /* in foreign/fdwapi.h */
|
||||
T_IndexAmRoutine, /* in access/amapi.h */
|
||||
T_TsmRoutine /* in access/tsmapi.h */
|
||||
T_TsmRoutine, /* in access/tsmapi.h */
|
||||
T_ForeignKeyCacheInfo /* in utils/rel.h */
|
||||
} NodeTag;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user