[#6739] use rowid as count column for non-view collections to minimize the need of having the id field as covering index

This commit is contained in:
Gani Georgiev
2025-04-28 14:47:22 +03:00
parent 3885c93d59
commit d97b5b1f6c
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -79,6 +79,11 @@ func recordsList(e *core.RequestEvent) error {
searchProvider := search.NewProvider(fieldsResolver).Query(query)
// use rowid when available to minimize the need of a covering index with the "id" field
if !collection.IsView() {
searchProvider.CountCol("_rowid_")
}
records := []*core.Record{}
result, err := searchProvider.ParseAndExec(e.Request.URL.Query().Encode(), &records)
if err != nil {