Every application is a bit different, but it's not that the PostgreSQL design is a loser in all regards. It's not like bubble sort.
Every application is a bit different, but it's not that the PostgreSQL design is a loser in all regards. It's not like bubble sort.
When doing game development in the early 2000s I learned that bubble sort is not a loser in all regards. It performs well when a list is usually almost sorted. One situation when this is the case is in 3D rendering, which sorts objects by their distance from the camera. As you move the camera around or rotate it, bubble sort works very well for re-sorting the objects given the order they had in the previous frame.
To prevent bad worst-case scenarios you can count the number of comparisons that failed on the last pass and the number of passes you have performed so far, then switch to a different sort algorithm after reaching a threshold.