PostGIS
2.4.9dev-r@@SVN_REVISION@@
|
|
static |
In order to do useful selectivity calculations in both 2-D and N-D modes, we actually have to generate two stats objects, one for 2-D and one for N-D.
You would think that an N-D histogram would be sufficient for 2-D calculations of selectivity, but you'd be wrong. For features that overlap multiple cells, the N-D histogram over-estimates the number of hits, and can't contain the requisite information to correct that over-estimate. We use the convenient PgSQL facility of stats slots to store one 2-D and one N-D stats object, and here in the compute function we just call the computation twice, once in each mode. It would be more efficient to have the computation calculate the two histograms simultaneously, but that would also complicate the (already complicated) logic in the function, so we'll take the CPU hit and do the computation twice.
Definition at line 1820 of file gserialized_estimate.c.
References compute_gserialized_stats_mode(), gserialized_analyze_nd(), and PG_FUNCTION_INFO_V1().
Referenced by gserialized_analyze_nd().