Error "1038 Out of sort memory, consider increasing sort buffer size

后端 未结 4 1121

In symfony2, doctrine2, I have a query which triggers an error :

Error \"1038 Out of sort memory, consider increasing server sort buffer size

T

相关标签:
4条回答
  • 2021-02-13 12:06

    In my case what actually helped without increasing the sort buffer size was to create indexes for the fields that I was ordering on. I'm not sure if it would work when joining tables but it will work when trying to order a single table which is very large.

    0 讨论(0)
  • 2021-02-13 12:10

    Just run mysql query

    SET GLOBAL sort_buffer_size = 256000000 // It'll reset after server restart
    

    To set permanent

    Edit below file and add

    sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
    
    sort_buffer_size = 256000000
    
    sudo service mysql restart
    
    0 讨论(0)
  • 2021-02-13 12:21

    If you are using the docker mysql container add the follow setting in docker-compose.yml:

    db:
        image: mysql:8
        command: --sort_buffer_size=512K
    
    0 讨论(0)
  • 2021-02-13 12:29

    You probably need to increase the buffer size of mysql in the /etc/mysql/my.cnf , set

    sort_buffer_size to 256K
    
    0 讨论(0)
提交回复
热议问题