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:
@@ -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 "
|
||||
}
|
||||
|
Reference in New Issue
Block a user