datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

[DoctrineDataSource] Allow not to use Doctrine's Paginator

Open jaroslavlibal opened this issue 2 years ago • 0 comments

In DoctrineDataSource the Paginator from Doctrine (Doctrine\ORM\Tools\Pagination\Paginator) is used for situations when JOIN or GROUP BY is used.

I assume this is because of the "to-many" relationships - we want the number of entries on the page match the selected number. In this case, however, Doctrine runs an additional SQL query to determine the number of results, which can take quite a long time on a large databases (DISTINCT, MIN, GROUP BY...).

This (if I am only using to-one relations) might not be necessary and I would like to be able to disable the use of the external Paginator from Doctrine.

Is that a legitimate request or am I missing something, please? My idea is e.g. new public method disableDoctrinePaginator() that stores this request in a private variable. This is then used in the existing private method usePaginator().

jaroslavlibal avatar Feb 22 '23 12:02 jaroslavlibal