1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-13 05:49:16 +00:00

VAI: Replace namespace+name default sort with id (#724)

* Sort by ID rather than metadata.namespace,metadata.name

- In tests add an id field to the list of fields to cache/create and to the objects.

* Add benchmark tests to compare sorting by ns/name vs id.
This commit is contained in:
Eric Promislow
2025-08-07 15:42:33 -07:00
committed by GitHub
parent 97b595d551
commit dbd2818d22
3 changed files with 157 additions and 3 deletions

View File

@@ -794,7 +794,8 @@ func (l *ListOptionIndexer) constructQuery(lo *sqltypes.ListOptions, partitions
} else {
// make sure one default order is always picked
if l.namespaced {
query += "\n ORDER BY f.\"metadata.namespace\" ASC, f.\"metadata.name\" ASC "
// ID == metadata.namespace + "/" + metaqata.name
query += "\n ORDER BY f.\"id\" ASC "
} else {
query += "\n ORDER BY f.\"metadata.name\" ASC "
}