Provide real selectivity estimators for inet/cidr operators.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 89840d7d3fa943cb932f6a00707fdb17a9cab001
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2015-04-01T21:11:21Z
Releases: 9.5.0
Provide real selectivity estimators for inet/cidr operators.

This patch fills in the formerly-stub networksel() and networkjoinsel()
estimation functions.  Those are used for << <<= >> >>= and && operators
on inet/cidr types.  The estimation is not perfect, certainly, because
we rely on the existing statistics collected for the inet btree operators.
But it's a long way better than nothing, and it's not clear that asking
ANALYZE to collect separate stats for these operators would be a win.

Emre Hasegeli, with reviews from Dilip Kumar and Heikki Linnakangas,
and some further hacking by me

Files

PathChange+/−
src/backend/utils/adt/network_selfuncs.c modified +977 −3