How to configure grafana to fetch data when need it?

The question seems to be quite unusual but here’s the full problem statement

We are currently monitoring MySQL database tables in Grafana using MySQL Datasource

Some tables in MySQL have more than lakhs of records ( SELECT queries )

We are using Table panel to visualize MySQL Table data and under metrics, we have our SELECT queries which give us lakhs of record at a time

What we are looking for is that rather than fetching all data from the database at once in Grafana, Is there any way that when we click " Next " or " 2 " the next set of records can be directly fetched from the database itself (Pagination) so that Grafana won’t get hanged.

For example,

select * from database.data will return lakhs of data so we need data as per click i.e when we click next button or 2, further set of record should get fetched from the database, not from Grafana in-memory.

Is there any way to do this?