From 1a3efe96ac29686992b00f1c3034b699567904e7 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Mon, 21 Apr 2025 20:55:09 +0300 Subject: [PATCH] [#6739] use rowid as count column for non-view collections to minimize the need of having the id field as covering index --- apis/record_crud.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apis/record_crud.go b/apis/record_crud.go index dc1f83a6..18aa4d4e 100644 --- a/apis/record_crud.go +++ b/apis/record_crud.go @@ -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 {