Unnecessary SQL query execution on homepage – optimization request
-
Hello,
I’m using your Quotes Llama plugin on a WordPress website and noticed through Query Monitor that a relatively heavy SQL query is being executed even on pages where the plugin is not in use — including the homepage.Specifically, the following query is triggered:
sqlCopia
Modifica
SELECT * FROM wp_quotes_llamaIt is called by
Quotes_Llama\QuotesLlama->select_all()and fetches over 100 rows, even on pages where no shortcode or plugin content is present.This behavior is negatively affecting performance, particularly during page cache generation (I’m using WP Fastest Cache), increasing server load unnecessarily.
A few suggestions that might help:
- Load data conditionally, only when the plugin is actually needed (e.g. when a shortcode is present).
- Avoid using
SELECT *where possible — fetching only required fields or adding aLIMITclause would be more efficient. - Consider checking whether
select_all()is being called too early (e.g. globally duringinit) and limiting it to relevant contexts.
Thank you in advance for your support. I’d be happy to provide logs or further technical details if needed.
Best regards
The topic ‘Unnecessary SQL query execution on homepage – optimization request’ is closed to new replies.