Optimize sort and deduplication in ginExtractEntries()

Remove NULLs from the array first, and use qsort to deduplicate only
the non-NULL items. This simplifies the comparison function. Also
replace qsort_arg() with a templated version so that the comparison
function can be inlined. These changes make ginExtractEntries() a
little faster especially for simple datatypes like integers.

Author: David Geier <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6f5ad00ab763f9e029ec591f7f650bd09c1e933f

Modified Files
--------------
src/backend/access/gin/ginutil.c | 151 +++++++++++++++++----------------------
src/include/access/gin_private.h |   2 +-
2 files changed, 68 insertions(+), 85 deletions(-)

Reply via email to