• Robert Haas's avatar
    Avoid copying index tuples when building an index. · 9f03ca91
    Robert Haas authored
    The previous code, perhaps out of concern for avoid memory leaks, formed
    the tuple in one memory context and then copied it to another memory
    context.  However, this doesn't appear to be necessary, since
    index_form_tuple and the functions it calls take precautions against
    leaking memory.  In my testing, building the tuple directly inside the
    sort context shaves several percent off the index build time.
    Rearrange things so we do that.
    
    Patch by me.  Review by Amit Kapila, Tom Lane, Andres Freund.
    9f03ca91
hashsort.c 2.97 KB