mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
SQL Joins performed without indexes #1519
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#1519
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @djjudas21 on GitHub (Aug 6, 2022).
1. What is not working as documented?
Please be as specific as possible and explain what part of the software is not working as documented. "No photos found" would not be detailed enough. Also, never report known issues or features not yet implemented as bugs. Thank you!
I am using the PhotoPrism with the MariaDB database backend, and performance of the app is sometimes slow. I decided to run
mysqltuneragainst MariaDB to check configuration. It warned that there are some JOINs being performed without an index.Unfortunately it does not say which query/queries use a JOIN without an index, but I will try and enable query logging.
2. How can we reproduce it?
Steps to reproduce the behavior:
mysqltunerPhotos: ~65000, mostly JPG
Thumbnail quality: 85%
Max thumbnail size: 1920px
3. What behavior do you expect?
I expect all JOINs to use indexed columns
4. What could be the cause of your problem?
A missing index on a column. I read #1811 where you improved the SQL queries and added indexes, but maybe there are more JOINs that need indexes.
As a workaround I can follow
mysqltuner's advice:5. Can you provide us with example files for testing, error logs, or screenshots?
It is not possible to make MariaDB show you the contents of JOINs without indexes.
6. Which software versions do you use?
(a) PhotoPrism Architecture & Build Number: 220728-jammy on AMD64
(b) Database Type & Version: MariaDB
(c) Operating System Types & Versions: Kubernetes
(d) Browser Types & Versions: Chrome
(e) Ad Blockers, Browser Plugins, and/or Firewall Software? No
7. On what kind of device is PhotoPrism installed?
This is especially important if you are reporting a performance, import, or indexing issue. You can skip this if you're reporting a problem you found in our public demo, or if it's a completely unrelated issue, such as incorrect page layout.
(a) Device / Processor Type: 3x nodes, each with Intel i5-6500T
(b) Physical Memory & Swap Space in GB: 3x nodes, each with 16GB RAM and swap disabled
(c) Storage Type: Photos are on network storage backed by HDD. Metadata, cache and MariaDB data are on network storage backed by SSD.
(d) Anything else that might be helpful to know? This is a 3x node Kubernetes cluster. PhotoPrism and MariaDB are configured to run on different nodes in the cluster so they can both consume max resources.
8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?
My client PC is on the same wired LAN as the Kubernetes cluster that is running PhotoPrism. Kubernetes is using NGINX Ingress as a reverse proxy.
@lastzero commented on GitHub (Aug 6, 2022):
Depends on the query and table size. There is no law that says you must always use an index for everything, so it's not a bug as such. Please find out what specific query is slow and go through our Troubleshooting Checklists before opening a BUG REPORT. For example: https://docs.photoprism.app/getting-started/troubleshooting/performance/
Please also remove placeholders for readability. Thank you! ❤️