Title: Performance/Query time
Last modified: September 18, 2026

---

# Performance/Query time

 *  Resolved [extremecarver](https://wordpress.org/support/users/extremecarver/)
 * (@extremecarver)
 * [14 hours, 37 minutes ago](https://wordpress.org/support/topic/performance-query-time/)
 * Analyzing the Timeline of my website – TOC+ is one of the slowest plugins to 
   load – now of course this will only apply to logged in users – as non logged 
   in get to see a cached page – but I wonder why the plugin seemingly (I may be
   wrong and misunderstand something) needs to run database queries on every page
   load.
 * Overall the queries on my relatively plugin heavy site take about 0.20 seconds–
   But TOC+ alone takes around 0.01-0.02 seconds for it’s query. Yes it’s not render
   blocking so no essential slowdown as other queries are started in parallel – 
   but I feel this is quite long for something not depending on external sources
   to load. And it’s the slowest query of all queries on my website by quite some
   margin. Most queries need only 1/10 of the time or less.
 * The offending query is:
 * **UPDATE** `wp_options`
   **SET** `option_value` = ‘1790366945’**WHERE** `option_name`
   = ‘_transient_timeout_aioseo_plugin_cache_table_exists’
    1. `update_option()`
       wp-includes/option.php:963
    2. `set_transient('aioseo_plugin_cache_table_exists')`
       wp-includes/option.php:1569
    3. `AIOSEO\TableOfContents\Core\Cache->checkIfTableExists()`
       wp-content/plugins/
       table-of-contents-plus/app/Core/Cache.php:76
    4. `do_action('init')`
       wp-settings.php:779

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [MM Aurangajeb](https://wordpress.org/support/users/aurangajeb/)
 * (@aurangajeb)
 * [13 hours, 50 minutes ago](https://wordpress.org/support/topic/performance-query-time/#post-19023836)
 * Hi [@extremecarver](https://wordpress.org/support/users/extremecarver/) ,
 * Thanks for reaching out!
 * TOC+ checks once per request that its cache table is present, then refreshes 
   a transient so the next request can skip the check. The refresh isn’t conditional,
   so it rewrites the transient on every request that reaches PHP. The stored timeout
   is a timestamp that moves every second, so WordPress can’t skip the write. I 
   reproduced it here, and it’s actually three `wp_options` UPDATEs per request 
   rather than the one you caught.
 * Thanks for posting the trace. It made this quick to confirm. It’s now filed with
   our development team internally for further investigation.
 * I’ll post back here when the fix ships.
 * Thanks again for bringing this to our attention!
 *  Thread Starter [extremecarver](https://wordpress.org/support/users/extremecarver/)
 * (@extremecarver)
 * [13 hours, 44 minutes ago](https://wordpress.org/support/topic/performance-query-time/#post-19023838)
 * perfect thanks. I simply guess it could be faster – and that would be great. 
   Gives less importance then to various other performance / caching plugins.
 * Maybe even the TOC could somewhat be cached and inserted by the plugin instead
   of generated on the fly on each pageload. Though maybe I overlook some reason
   why it needs to be generated each time instead of just when the page content 
   changes.
 * In the past I’ve had way more offending plugins, or my translate plugin still
   takes way more time – but not on a single (or triple) query.
    -  This reply was modified 13 hours, 43 minutes ago by [extremecarver](https://wordpress.org/support/users/extremecarver/).
 *  Plugin Support [MM Aurangajeb](https://wordpress.org/support/users/aurangajeb/)
 * (@aurangajeb)
 * [13 hours, 13 minutes ago](https://wordpress.org/support/topic/performance-query-time/#post-19023851)
 * Hi [@extremecarver](https://wordpress.org/support/users/extremecarver/) ,
 * The TOC isn’t built from the stored post content. TOC+ hooks `the_content` at
   priority 100, after shortcodes and every other content filter, then parses the
   finished HTML in memory. No database query in that part, which is why it never
   showed up in your timeline.
 * That’s also why it isn’t cached. The headings at output time aren’t always the
   ones in the stored content. Your translation plugin is the clearest case, since
   the heading text and the anchor IDs built from it change per language. A cache
   keyed on the post would go stale and start emitting anchors that don’t match 
   the page.
 * I’ll update the thread when the fix ships.
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fperformance-query-time%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/table-of-contents-plus/assets/icon-256x256.png?rev=1151771)
 * [Table of Contents Plus – Automatic Table of Contents for Posts & Pages](https://wordpress.org/plugins/table-of-contents-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/table-of-contents-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/table-of-contents-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/table-of-contents-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/table-of-contents-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/table-of-contents-plus/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [MM Aurangajeb](https://wordpress.org/support/users/aurangajeb/)
 * Last activity: [13 hours, 13 minutes ago](https://wordpress.org/support/topic/performance-query-time/#post-19023851)
 * Status: resolved