-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Table ext_log_entries very very slow on queries #2785
Comments
What's generating this query? Is it something in your application? Is it something in this package? If it's in this package, what is it? Because you're doing wildcard LIKE conditions on every column in the table, I don't find it too surprising that it's somewhat slow and this query would be better written only targeting needed columns, and for columns with fixed values (i.e. the |
I changed the query a bit to run on console for postgres 16.
|
@wehostadm, the field action is not indexed by default. |
@wehostadm you manage the structure of LogEntry via migrations doctrine. |
@ytilotti Only for entities that I managed not for those inside Bundles. Do I need to create an Entity that inherits Somethink like : ? |
I don't use EasyAdmin so I don't know how much help I could offer here, but based on ~5 minutes of looking at a couple of screenshots and the filters docs, it seems like there'd be ways to better build the filters for a log entry list (as I'm assuming you've added a section that lets you browse
The worst field to try and support filtering for is the As far as the custom entity goes, yes, that should do the trick. The other thing is to make sure you've added the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Environment
Windows 10 with MySQL
Package
show
Doctrine packages
show
PHP version
Subject
Minimal repository with the bug
Nothing
Steps to reproduce
Have a huge amount of data in ext_log_entries table (around 700 000 for me)
The query :
SELECT DISTINCT e0.id AS id_0, e0_.id AS id_1 FROM ext_log_entries e0_ WHERE (e0_.id = 818043 OR LOWER(e0_.action) LIKE '%818043%' OR LOWER(e0_.object_id) LIKE '%818043%' OR LOWER(e0_.object_class) LIKE '%818043%' OR e0_.version = 818043 OR LOWER(e0_.data) LIKE '%818043%' OR LOWER(e0_.username) LIKE '%818043%') AND e0_.username IS NOT NULL ORDER BY e0_.id DESC LIMIT 30;_
Expected results
Having a query to search a log quick
Actual results
The query to search a log takes around 8 seconds or more
The text was updated successfully, but these errors were encountered: