From 9b27a091317785cc61b68e924e4351884e656197 Mon Sep 17 00:00:00 2001 From: mmomjian <50788000+mmomjian@users.noreply.github.com> Date: Thu, 7 Mar 2024 23:28:51 -0500 Subject: [PATCH] docs: Update DB queries (#7730) --- docs/docs/guides/database-queries.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/guides/database-queries.md b/docs/docs/guides/database-queries.md index 49b7330fb..fe369f899 100644 --- a/docs/docs/guides/database-queries.md +++ b/docs/docs/guides/database-queries.md @@ -13,7 +13,7 @@ Run `docker exec -it immich_postgres psql immich ` to connect to th ## Assets :::note -The `"originalFileName"` column is the name of the uploaded file _without_ the extension. +The `"originalFileName"` column is the name of the file at time of upload, including the extension. ::: ```sql title="Find by original filename" @@ -40,6 +40,10 @@ SELECT * FROM "assets" where "livePhotoVideoId" IS NOT NULL; SELECT "assets".* FROM "exif" LEFT JOIN "assets" ON "assets"."id" = "exif"."assetId" WHERE "exif"."assetId" IS NULL; ``` +```sql title="size < 100,000 bytes, smallest to largest" +SELECT * FROM "assets" JOIN "exif" ON "assets"."id" = "exif"."assetId" WHERE "exif"."fileSizeInByte" < 100000 ORDER BY "exif"."fileSizeInByte" ASC; +``` + ```sql title="Without thumbnails" SELECT * FROM "assets" WHERE "assets"."resizePath" IS NULL OR "assets"."webpPath" IS NULL; ```