From d97b5b1f6c4a67a97bb552835976a4de8d064c75 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Mon, 28 Apr 2025 14:47:22 +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 --- CHANGELOG.md | 3 +++ apis/record_crud.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22364c9b..f22d0cb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ ## v0.27.2 (WIP) +- Added workers pool when cascade deleting record files to minimize _"thread exhaustion"_ errors ([#6780](https://github.com/pocketbase/pocketbase/discussions/6780)). + - Updated the excerpt modifier to properly account for multibyte characters ([#6778](https://github.com/pocketbase/pocketbase/issues/6778)). + ## v0.27.1 - Updated example `geoPoint` API preview body data. 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 {