-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/devices
page with filters cause DB load with thousands of devices
#1501
Comments
In 99.99999% of cases, a few indexes will fix these issues. First off, the second Also, because of how LiveView works, these queries are being called twice each, once on dead view load, and once on mount. We can also fix this by only loading the data on mount using something like I can also see, from checking the indexes in the DB, that we are missing two indexes for the I think our big culprit is the recent change to the double wildcards for We will need to optimize the index used for it to be performant. |
Reading over https://www.cybertec-postgresql.com/en/postgresql-more-performance-for-like-and-ilike-statements/, we would need to switch the index used by
|
Updated with some Before we get too lost on a red-herring, we are currently deployed to 1684dcf which is before the double wildcard on |
Describe the bug
First let me say the feature to support saved and shareable search params in #1458 is awesome! 🎉
But I do think it is causing us issues 😱
We've recently had a situation where our DB load was very high causing lots of alerts and these 2 queries were the big offenders:
SQL Things
Filtering
/devices
EXPLAIN ANALYZE with tags
EXPLAIN ANALYZE with identifier
Counting devices (somewhere?)
These seem to be coming from the
/devices
index page when filtering. My hunch is multiple people have left the/devices
index page open in tabs and something is triggering thehandle_params
callback to cause research quite frequently. Though I really have no knowledge or proof to back thatTo Reproduce (my guess?)
Steps to reproduce the behavior:
identifier
and/ortags
The text was updated successfully, but these errors were encountered: