Hello Guys, help please:
I have the following scenario:
- Firebird
- Table with 1 million records, for example.
- if, I select * from table, 1 million records will be loaded on the server
- on the client, UniDBGrid, using pagination, will paginate, by default, 25 records per page.
In this scenario, the customer will browse the data normally.
But before displaying the first 25 records in this table, the server loaded 1 million records.
I want to relieve the server by optimizing the query:
example: for example with pagesize = 10
First 10 records (page 1)
SELECT FIRST 10 SKIP 0 * FROM TABLE
+10 records (page 2)
SELECT FIRST 10 SKIP 10 * FROM TABLE
+10 records (page 3)
SELECT FIRST 10 SKIP 20 * FROM TABLE
doing this way unburden the server.
In UniDBGrid I can already do the first part, that is, page 1 is ok. I used the onRecordCount event to set the total number of records in the table (1 million).
And he creates the pages as expected.
The problem is when I press to go to the next page. What event would you use, in this case to be able to get the current page so I can redo the query for
bring more records. To do this, you would need to capture the current page number of the UniDBGrid. Does anyone know how to do this?
In short, I need to do the paging manually.
sorry for the text size, but it is to be as clear as possible.