### Apache Airflow version

2.5.0

### What happened

We're currently running a suboptimal setup where database connectivity is laggy, 125ms roundtrip.

This has interesting consequences. For example, `airflow roles list` is really slow. Turns out that it's doing a lot of individual queries.

### What you think should happen instead

Ideally, listing roles should be a single (perhaps complex) query.

### How to reproduce

We're using py-spy to sample program execution:

```bash
$ py-spy record -o spy.svg -i --rate 250 --nonblocking airflow roles list
```
Now, to see the bad behavior, the database should incur significant latency.

### Operating System

Linux

### Versions of Apache Airflow Providers

_No response_

### Deployment

Official Apache Airflow Helm Chart

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

return self.get_app.config["LANGUAGES"]
    @property
    def version(self):
        """
        Get the current F.A.B. version
        :return: String with the current F.A.B. version
        """
        return __version__
    def _add_global_filters(self):
        self.template_filters = TemplateFilters(self.get_app, self.sm)
    def _add_global_static(self):
        bp = Blueprint(
            "appbuilder",
            "flask_appbuilder.base",
            url_prefix="/static",
            template_folder="templates",
            static_folder=self.static_folder,
            static_url_path=self.static_url_path,
        )
        self.get_app.register_blueprint(bp)
    def _add_admin_views(self):
        """Register indexview, utilview (back function), babel views and Security views."""
        self.indexview = self._check_and_init(self.indexview)
        self.add_view_no_menu(self.indexview)
        self.add_view_no_menu(UtilView())
        self.bm.register_views()
        self.sm.register_views()
    def _add_addon_views(self):