Optimize settings save: batch operations reduce queries from ~70 to 3#1483
Merged
nielsdrost7 merged 4 commits intoprep/v172from Mar 23, 2026
Merged
Optimize settings save: batch operations reduce queries from ~70 to 3#1483nielsdrost7 merged 4 commits intoprep/v172from
nielsdrost7 merged 4 commits intoprep/v172from
Conversation
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize settings saving with batch operations
Optimize settings save: batch operations reduce queries from ~70 to 3
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Settings save currently executes ~30-40 individual
save()calls, each performing a SELECT and INSERT/UPDATE. This generates ~60-80 database queries per settings form submission.Changes
Mdl_settings::save_batch()— Single-query batch insert/update using CodeIgniter'sinsert_batch()andupdate_batch()Performance
Query reduction: ~70 queries → 3 queries (96% reduction)
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/DASPRiD/Enum/zipball/b5874fa9ed0043116c72162ec7f4fb50e02e7cce/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/PHPMailer/PHPMailer/zipball/d1ac35d784bf9f5e61b424901d5a014967f15b12/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/Setasign/FPDF/zipball/0838e0ee4925716fcbbc50ad9e1799b5edfae0a0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/Setasign/FPDI/zipball/4b53852fde2734ec6a07e458a085db627c60eada/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/endroid/qr-code/zipball/0db25b506a8411a5e1644ebaa67123a6eb7b6a77/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/laravel/pint/zipball/54cca2de13790570c7b6f0f94f37896bee4abcb5/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/moneyphp/money/zipball/b358727ea5a5cd2d7475e59c31dfc352440ae7ec/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/mpdf/mpdf/zipball/b59670a09498689c33ce639bac8f5ba26721dab3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/f25a0153d645e234f9db42e5433b16d9b113920f/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/a633da6065e946cc491e1c962850344bb0bf3e78/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/paragonie/random_compat/zipball/96c132c7f2f7bc3230723b66e89f8f150b29d5ae/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpstan/phpstan/zipball/c6f73a2af4cbcd99c931d0fb8f08548cc0fa8224/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/pocketarc/codeigniter/zipball/d310726565c12ba99b8037e8fb231ed739258e6e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/rectorphp/rector/zipball/ca9ebb81d280cd362ea39474dabd42679e32ca6b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/smhg/sepa-qr-data-php/zipball/837d98eae6fdcf61aaffddb5d9c61b535ee7ce1a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/stripe/stripe-php/zipball/7e1c4b5d2beadeaeddc42fd1f8a50fdb18b37f30/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/var-dumper/zipball/131fc9915e0343052af5ed5040401b481ca192aa/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/h8oCCz /usr/bin/composer install --no-interaction(http block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.