Laravel MySQL查询内存不足

I have an old Laravel-5.1 app that I'm trying to update to a later version.

I've started by updating PHP from 5.6.x to 7.1.20.

When testing, a simple SQL query makes the system run out of memory:

DB::table('my_table')->where('onHold', 0)->where('status', 'OPEN')->first();

There are only eight rows in the table.

Error message: PHP Fatal error: Out of memory (allocated 7528775680) (tried to allocate 7514099712 bytes)