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

Add more database indexes #6683

Merged
merged 9 commits into from Jan 5, 2024
Merged

Add more database indexes #6683

merged 9 commits into from Jan 5, 2024

Conversation

Toflar
Copy link
Member

@Toflar Toflar commented Jan 3, 2024

Fixes #6681

@contao/developers I've only added indexes to the columns that were part of my slow query log. Of course, that will probably be different in other setups. An alternative would be to automate adding the indexes for columns such as

  • id
  • pid
  • sorting
  • ptable
  • fields with relation of 'type'=>'hasOne' or 'type'=>'belongsTo'

Not sure if we'd end up having too many indexes?

@Toflar Toflar requested a review from a team January 3, 2024 17:51
@Toflar Toflar added this to the 5.3 milestone Jan 3, 2024
@Toflar Toflar mentioned this pull request Jan 3, 2024
Copy link
Member

@ausi ausi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not add the index tl_content.ptable and tl_page.dns,fallback,published,start,stop, see code comments.

The rest LGTM 🚀

core-bundle/contao/dca/tl_content.php Outdated Show resolved Hide resolved
core-bundle/contao/dca/tl_content.php Outdated Show resolved Hide resolved
core-bundle/contao/dca/tl_page.php Outdated Show resolved Hide resolved
@Toflar Toflar requested review from ausi and leofeyer January 4, 2024 08:48
@leofeyer leofeyer changed the title Added more database indexes Add more database indexes Jan 4, 2024
ausi
ausi previously approved these changes Jan 4, 2024
Copy link
Member

@ausi ausi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, apart from #6683 (comment)

ausi
ausi previously approved these changes Jan 5, 2024
@leofeyer leofeyer merged commit 55d7750 into contao:5.x Jan 5, 2024
16 checks passed
@leofeyer
Copy link
Member

leofeyer commented Jan 5, 2024

Thank you @Toflar.

@Toflar Toflar deleted the fix/missing-indexes branch January 5, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow queries
4 participants