[wp-trac] [WordPress Trac] #62790: "autoload" index is not used
WordPress Trac
noreply at wordpress.org
Tue Feb 25 00:40:24 UTC 2025
#62790: "autoload" index is not used
--------------------------+--------------------------
Reporter: kkmuffme | Owner: joemcgill
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 6.8
Component: Database | Version: 5.3
Severity: minor | Resolution:
Keywords: needs-patch | Focuses: performance
--------------------------+--------------------------
Comment (by joemcgill):
Replying to [comment:6 kkmuffme]:
> How did you test that? The performance "benefit" (= actually removing
the performance penalty) of removing the index is when adding or updating
data to the options table. Removing the index slightly speeds up
adding/updating data and reduces CPU load. For people where this index
didn't provide any gains, this will be minimal. For people where this
index at some point did provide gains, the benefits of removing them will
be bigger
Thanks for clarifying that the performance concern is about
updating/adding options rather than reading options. I was focused on the
query time used when calling `wp_load_alloptions()`, which is what will
have the biggest impact on most end users.
> **What should happen, I guess, is that possibly redundant (yes, on,
auto-on, ...) are reduced to a single value (e.g. "on") like it used to
be, as this will make sure the index is used again.**
> While this is straightforward for yes/on no/off, someone who is familiar
why/for what auto/auto-on was implemented should take a look at if those
are really necessary?
I disagree with this suggestion. These values were added intentionally as
a part of #42441 in order to maintain backwards compatibly, while opening
up the ability for use to move away from autoloading all options by
default, unless a developer remembers to explicitly pass a falsey value to
the $autoload param when calling `add|update_option()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62790#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list