You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-27 08:27:06 +02:00
[#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:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user