[#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-21 20:55:09 +03:00
parent 18f152a0e7
commit 1a3efe96ac
1 changed files with 5 additions and 0 deletions

View File

@ -79,6 +79,11 @@ func recordsList(e *core.RequestEvent) error {
searchProvider := search.NewProvider(fieldsResolver).Query(query) 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{} records := []*core.Record{}
result, err := searchProvider.ParseAndExec(e.Request.URL.Query().Encode(), &records) result, err := searchProvider.ParseAndExec(e.Request.URL.Query().Encode(), &records)
if err != nil { if err != nil {