here is a patch adding to cube extension support for compressed representation of point cubes. If cube is a point, i.e. has coincident lower left and upper right corners, than only one corner is stored. First bit of the cube header indicates whether the cube is point or not. Few moments:
* Patch preserves binary compatibility with old indices
New representation of points will work in both index and heap. So, we should speak about just compatibility with old cubes.
* All functions that create cubes from user input, check whether it is a point or not * All internal functions that can return cubes takes care of all cases where a cube might become a point * Added tests for checking correct point behavior
I think ordering operator should be extracted into separated patch together with another ordering operators of your project.
Patch contains some formatting issues. For example, this comment
/* Point can arise in two cases:
1) When argument is point and r == 0
2) When all coordinates was set to their averages */
should contain star sign on the beginning of each line. Also it will be reflowed by pgindent. Correct formatting for this comment should look like this: