File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,14 +38,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 h1:5fFjR/ToSOzB2OQ/XqWpZBmNvmP/
3838github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 /go.mod h1:qgFDZQSD/Kys7nJnVqYlWKnh0SSdMjAi0uSwON4wgYQ =
3939github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk =
4040github.com/aws/smithy-go v1.24.0 /go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0 =
41- github.com/carli2/hybridsort v0.0.0-20260319191746-8429712d7a1c h1:h9PAuqFyYi8dCWABYlaiJjzpY9KmzXZsNUPU6RnZrGI =
42- github.com/carli2/hybridsort v0.0.0-20260319191746-8429712d7a1c /go.mod h1:ZSL9x9C2qLz4fL7VZdCs7QZCqNBkBZkcYtY0Fcw2Ezo =
43- github.com/carli2/hybridsort v0.0.0-20260319194603-ddd18ae27ffa h1:nS1j57V0eKCC2ydo3ja9QTP2hl0EI/vntgp8cVJ1rVw =
44- github.com/carli2/hybridsort v0.0.0-20260319194603-ddd18ae27ffa /go.mod h1:ZSL9x9C2qLz4fL7VZdCs7QZCqNBkBZkcYtY0Fcw2Ezo =
45- github.com/carli2/hybridsort v0.0.0-20260319211747-bc628a3877c1 h1:YhHOYcRJ5z+Vc2ly2qJnAAF15qPYxQR39sibTmDfKUM =
46- github.com/carli2/hybridsort v0.0.0-20260319211747-bc628a3877c1 /go.mod h1:ZSL9x9C2qLz4fL7VZdCs7QZCqNBkBZkcYtY0Fcw2Ezo =
47- github.com/carli2/hybridsort v0.0.0-20260319212745-ac6f7edeb1b1 h1:L5JNXOg6HLjGecOzzrxR9itw3Dal1NSd4nfXlPG4/tw =
48- github.com/carli2/hybridsort v0.0.0-20260319212745-ac6f7edeb1b1 /go.mod h1:ZSL9x9C2qLz4fL7VZdCs7QZCqNBkBZkcYtY0Fcw2Ezo =
4941github.com/carli2/hybridsort v0.0.0-20260319220658-610599b2851c h1:KLKFOH2gyHQ03+t9t29pQufv+GGVRBYCOTw3VEqFOX8 =
5042github.com/carli2/hybridsort v0.0.0-20260319220658-610599b2851c /go.mod h1:ZSL9x9C2qLz4fL7VZdCs7QZCqNBkBZkcYtY0Fcw2Ezo =
5143github.com/carli2/text v0.34.1-0.20260305004517-20c7a406302a h1:qnerlW5tSOXN0OYjUAscEZWzTzTzSP+ASRJwpUdfya4 =
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ package storage
1919
2020import "sort"
2121import "sync"
22- import "github.com/carli2/hybridsort"
2322import "sync/atomic"
2423import "time"
2524import "strings"
2625
26+ import "github.com/carli2/hybridsort"
2727import "github.com/google/btree"
2828import "github.com/launix-de/memcp/scm"
2929
@@ -507,16 +507,16 @@ func (s *StorageIndex) buildIndex(cols []colGetter) {
507507 }
508508 // sort indexes; skip non-sorted matcher columns (they don't affect
509509 // sort order, they are query-level overlays for pruning)
510- hybridsort .Slice (tmp , func (i , j int ) bool {
510+ hybridsort .HybridSort (tmp , func (a , b uint32 ) bool {
511511 for colIdx , g := range cols {
512512 if len (s .ColMatchers ) > colIdx && ! s .ColMatchers [colIdx ].IsSorted () {
513513 continue
514514 }
515- a := g .get (tmp [ i ] )
516- b := g .get (tmp [ j ] )
517- if scm .Less (a , b ) {
515+ va := g .get (a )
516+ vb := g .get (b )
517+ if scm .Less (va , vb ) {
518518 return true // less
519- } else if ! scm .Equal (a , b ) {
519+ } else if ! scm .Equal (va , vb ) {
520520 return false // greater
521521 }
522522 // otherwise: next iteration
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ Copyright (C) 2023-2026 Carl-Philip Hänsch
1717package storage
1818
1919import "fmt"
20- import "github.com/carli2/hybridsort"
2120import "sync"
2221import "sync/atomic"
2322import "time"
@@ -26,6 +25,7 @@ import "reflect"
2625import "runtime"
2726import "encoding/json"
2827import "encoding/binary"
28+ import "github.com/carli2/hybridsort"
2929import "github.com/google/uuid"
3030import "github.com/jtolds/gls"
3131import "github.com/launix-de/memcp/scm"
@@ -2078,10 +2078,9 @@ func (t *storageShard) rebuild(all bool) *storageShard {
20782078 }
20792079 }
20802080 idxCols := idx .Cols
2081- hybridsort .Slice (sortPerm , func (a , b int ) bool {
2081+ hybridsort .HybridSort (sortPerm , func (idA , idB uint32 ) bool {
20822082 for _ , colName := range idxCols {
20832083 var va , vb scm.Scmer
2084- idA , idB := sortPerm [a ], sortPerm [b ]
20852084 if idA < t .main_count {
20862085 va = t .columns [colName ].GetValue (idA )
20872086 } else {
You can’t perform that action at this time.
0 commit comments