From 5e22b01c61ecdccf9bed6bf0c49fdc312c0b7548 Mon Sep 17 00:00:00 2001 From: Sander Vocke Date: Wed, 29 Jan 2020 11:16:47 +0100 Subject: [PATCH] Set a limit on the number of query results. --- src/queries.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/queries.js b/src/queries.js index 7103530..ea685f1 100644 --- a/src/queries.js +++ b/src/queries.js @@ -248,7 +248,8 @@ export function image_query_with_where(maybe_where) { + "LEFT JOIN ImageTags ON Images.id=ImageTags.imageid " + "LEFT JOIN ImageInformation ON Images.id=ImageInformation.imageid " + "LEFT JOIN Tags ON ImageTags.tagid=Tags.id " + (maybe_where ? maybe_where : "") - + " GROUP BY Images.id;"; + + " GROUP BY Images.id LIMIT 300;"; + // TODO make the limit configurable and have a warning } // This query will return database entries with the fields "id" and "relativePath" for each matching album.