Re: Insertion Sort Improvements - Mailing list pgsql-hackers

From Benjamin Coutu
Subject Re: Insertion Sort Improvements
Date
Msg-id 6047084d3cc4d8cf4ef7@zeyos.com
Whole thread Raw
In response to Re: Insertion Sort Improvements  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: Insertion Sort Improvements
List pgsql-hackers
Getting back to improvements for small sort runs, it might make sense to consider using in-register based sorting via
sortingnetworks for very small runs. 

This talk is specific to database sorting and illustrates how such an approach can be vectorized:
https://youtu.be/HeFwVNHsDzc?list=PLSE8ODhjZXjasmrEd2_Yi1deeE360zv5O&t=1090

It looks like some of the commercial DBMSs do this very successfully. They use 4 512bit registers (AVX-512) in this
example,which could technically store 4 * 4 sort-elements (given that the sorting key is 64 bit and the tuple pointer
is64 bit). I wonder whether this could also be done with just SSE (instead of AVX), which the project now readily
supportsthanks to your recent efforts? 



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?
Next
From: Bharath Rupireddy
Date:
Subject: Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)