Skip to content
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

Get DataObject to automatically add the recommended index #300

Open
sminnee opened this issue Jun 2, 2020 · 2 comments
Open

Get DataObject to automatically add the recommended index #300

sminnee opened this issue Jun 2, 2020 · 2 comments

Comments

@sminnee
Copy link

sminnee commented Jun 2, 2020

The docs suggest that you add this index:

ALTER TABLE `QueuedJobDescriptor` ADD INDEX ( `JobStatus` , `JobType` )

DataObject can be configured to add this index automatically with the $indexes static property. That would ensure that all installs receive this performance enhancement.

@mfendeksilverstripe
Copy link
Contributor

There is already index on JobStatus. I'm not sure if adding index on JobType will give much performance gain as cardinality of this index is really low. Note that JobType is actually Queue type. What we typically refer to as type of job is the Implementation. Adding index on this field would probably make more sense but I still think the cardinality of this index is too low as well.

@sminnee
Copy link
Author

sminnee commented Jun 14, 2020

Right. I assumed that whoever wrote the doc (probably the original developer, @nyeholt) expected this index to be in place to the application to work well, but didn't investigate fully.

For my part I know that installations that don't have the job cleanup activated (and therefore get lots of completed jobs left in the system but hidden from the UI) end up with a very slow admin UI. I wondered if the absence of this index was the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants