[wp-trac] [WordPress Trac] #62790: "autoload" index is not used
WordPress Trac
noreply at wordpress.org
Tue Feb 25 11:21:02 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 kkmuffme):
Replying to [comment:7 joemcgill]:
> 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()`.
Ironically, that feature achieved the opposite of what it set out to do
though. By adding multiple different autoload values, it actually makes
loading the options slower since the index isn't used anymore and if it is
used (as seen by the "forced" cases) the query is actually slower in all
cases except if you actually do have a huge option value which is
prevented from being loaded.
I think the changes of that ticket must be seen in combination with the
index usage issue at hand here.
The better approach at that other ticket would have been to validate (eg
option value size) when adding/updating only and based on that assign
yes/no instead of adding additional values auto-on,... which make loading
options overall slower. Since whether an option should autoload or not is
already known at the point it gets saved, so it doesn't make sense to
delegate (some of) that logic to the point options are retrieved?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62790#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list