Skip to content

article_revisions & sort_buffer_size issue #2768

@AidasK

Description

@AidasK

Description

Article edit page is crashing due to unoptimal db query.

select * from `article_revisions` where `article_revisions`.`article_id` = 444 and `article_revisions`.`article_id` is not null order by created_at desc;

Error: Out of sort memory, consider increasing server sort buffer size

This can be easily solved by ordering by an indexed field instead, so order by id desc works.

Also edit page can perform a lot better and would not crash if revision payload would not be selected.

So ideal query would be:

select id, created_at from `article_revisions` where `article_revisions`.`article_id` = 444 and `article_revisions`.`article_id` is not null order by id desc;

Steps to reproduce

  1. Create and article with lots of languages and lots of block with a lot of revisions. 40 languages, 20 blocks & 20 revisions ± (nothing mind blowing)
  2. Article edit page is not loading due to mysql sort_buffer_size too low error

Expected result

Edit page should always load.

Actual result

500 error page is displayed instead.

Versions

Twill version: 3.4.1
Laravel: 11.x.x
PHP: 8.3
DB: Mysql 8.0.31.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions