Skip to content

improve performance of two product support methods#7175

Merged
akatsoulas merged 1 commit intomozilla:mainfrom
escattone:reduce-product-support-queries
Jan 14, 2026
Merged

improve performance of two product support methods#7175
akatsoulas merged 1 commit intomozilla:mainfrom
escattone:reduce-product-support-queries

Conversation

@escattone
Copy link
Copy Markdown
Contributor

@escattone escattone commented Jan 13, 2026

While working on #7173, I noticed that we could reduce the query count of the Product.has_ticketing_support property and the Product.questions_enabled() method.

@escattone escattone changed the title reduce query count in product support methods improve product support methods Jan 13, 2026
@escattone escattone changed the title improve product support methods improve performance of two product support methods Jan 13, 2026
return False
else:
return config.enable_zendesk_support
return self.support_configs.filter(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpicking: this query and the original one perform both a single query. The performance gain is negligible here and comes from the fetching and object initialization.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It won't perform another query for the zendesk_config object?

@akatsoulas akatsoulas merged commit 0429eaf into mozilla:main Jan 14, 2026
2 checks passed
@escattone escattone deleted the reduce-product-support-queries branch January 14, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants