• Tom Lane's avatar
    Improve INTERSECT/EXCEPT hashing by realizing that we don't need to make any · af95d7aa
    Tom Lane authored
    hashtable entries for tuples that are found only in the second input: they
    can never contribute to the output.  Furthermore, this implies that the
    planner should endeavor to put first the smaller (in number of groups) input
    relation for an INTERSECT.  Implement that, and upgrade prepunion's estimation
    of the number of rows returned by setops so that there's some amount of sanity
    in the estimate of which one is smaller.
    af95d7aa
outfuncs.c 53.1 KB