From 3399d0ef1b03bf1217d220dc9c94662faf84d7dd Mon Sep 17 00:00:00 2001 From: Las Zenow Date: Wed, 24 Jun 2020 11:07:54 +0000 Subject: [PATCH] Do the count stimated The DB is being overloaded by the qaueries --- lib/database/books.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/database/books.go b/lib/database/books.go index 606f45f..210732a 100644 --- a/lib/database/books.go +++ b/lib/database/books.go @@ -90,7 +90,7 @@ func (db *pgDB) getBooks(active bool, query string, length int, start int) (book OrderExpr(order, rankParams...). Offset(start). Limit(length). - SelectAndCount() + SelectAndCountEstimate(1000) return books, num, err }