I am studying big-O time-space complexities of different algorithms with the partial index of PostgreSQL 9.4:
- introsort (O(n log n)-time, O(log n)-space) and
- heapsort (O(n log(n))-time O(1)-space),
motivated by this thread. The introsort is using randomized quicksort to mostly sort the array, switching to heapsort if quicksort is to degenerate. I think the partial index implementation is not using any sorting algorithms with accesses. To access the data of the partial index is fast when the range is sufficiently small and the number of objects is less than one billion with 32-bit system. I am interested in how O(n log n)-time, O(log n)-space algorithms can work with the partial index with enough big ranges from the partial index.
How can you estimate suitable sorting/access algorithms in the partial index?
[email protected]
– Kassandry Aug 12 at 19:15