Assets Library Extremely Slow With Large Folders
### Node Version

20.17.0

### NPM/Yarn/PNPM Version

10.8.2

### Strapi Version

5.8.1

### Operating System

Linux (Other)

### Database

Strapi Cloud

### Javascript or Typescript

Typescript

### Reproduction URL

_No response_

### Bug Description

The API Uploads folder currently contains 576k assets, resulting in significant performance degradation when trying to load the page with the folder (not when opening the folder itself). The slow load times are severely impacting the usability of the asset library.

As a temporary workaround, I have moved the API Uploads folder into a subfolder to improve the root folder's performance. However, this solution is not ideal in the long term.

**Performance Observations:**
- Current Load Time: ~20 seconds (see attached image)
- Typical Load Time: Often exceeds 1 minute, making the asset library nearly unusable.

![Image](https://github.com/user-attachments/assets/256ab074-27ab-4c6a-99df-f4864cbe19be)

Here is the query that is causing the slowdown

```sql
select `t1`.`folder_id` as `__strapifolder_id`, count(*) AS count from `files` as `t0` left join `files_folder_lnk` as `t1` on `t0`.`id` = `t1`.`file_id` where (`t1`.`folder_id` in (1)) group by `t1`.`folder_id`
```

### Steps to Reproduce

1. Upload a rather large collection of image (>500k)
2. Navigate to the [Media Library](https://content.technologyadvice.com/admin/plugins/upload)
3. Observe slow load times

### Expected Behavior

A few things could mitigate this
1. Ability to disable counts
2. Ability to add custom indexes to the file/folder/lnk tables to speed up these queries
3. Create max number of assets per folder, doing some sort of chunking of API uploads

Ideally it shouldn't be possible to produce load times >1min on the folders routes


### Logs

```shell

```

### Code Snippets

_No response_

### Media

_No response_

### Additional information

_No response_

### Confirmation Checklist

- [x] I have checked the existing [issues](https://github.com/strapi/strapi/issues) for duplicates.
- [x] I agree to follow this project's [Code of Conduct](https://github.com/strapi/strapi/blob/develop/CODE_OF_CONDUCT.md).