Skip to content

12.1.0

Latest

Choose a tag to compare

@rez1dent3 rez1dent3 released this 27 Aug 18:59
· 1 commit to master since this release
9413357

What's Changed

  1. No code changes are required. Perform new package migrations;

  2. Four redundant indexes are removed:

    • transactions.payable_type_payable_id_ind — a duplicate of the morphs() index;
    • transactions.payable_type_ind — a prefix of payable_type_confirmed_ind;
    • transactions.transactions_payable_type_payable_id_index — a prefix of payable_type_confirmed_ind;
    • wallets.wallets_holder_type_holder_id_index — a prefix of the unique (holder_type, holder_id, slug);
  3. Every removed index was a duplicate or a leading prefix of a wider one, so no query loses its access path.
    EXPLAIN on the hot wallet queries gives the same plans before and after (on mysql they are identical —
    the optimizer used payable_confirmed_ind anyway). Measured on 1M transactions and 200k wallets:

    mysql pgsql
    index size 685 → 329 MB (-52%) 265 → 156 MB (-41%)
    insert of 50k rows -63% time -32% time

    The gain is in write throughput and disk footprint, reads stay the same;

  4. If you have a highload project, drop the indexes yourself
    (pt-online-schema-change
    for mysql, DROP INDEX CONCURRENTLY for pgsql), then add both migration names to the migrations table
    so they are not executed again. For a small project php artisan migrate is enough;

New Contributors

Full Changelog: 12.0.5...12.1.0