You can translate the question and the replies:

Using pagination with Denodo REST, is there a way to jump to the last page?

Is there a way to skip to the last page? For example, when paginating, you give denodo the start_index and also the count of records, is there a parameter I can use to jump to the last records in the dataset?
user
06-02-2017 12:05:04 -0500

3 Answers

Hi, I tried the following way and it worked for me Find the total no of rows that the view is returning by clicking the **Get** option after the"**Total number of rows in the resultset**" you have in your REST WS HTML. Now you can calculate the start_index for last page like: **Start_index = totalrows - count;** Example: I have total of 1000 rows and I have a limit of 10 rows per page. Then for the last page I need to give the count to be 10 and the start index to be 990. So my URL will look like http://localhost:9090/server/.../<view_name>**$count=10&$start_index=990** **Where start_index = 1000 - 10** Now this will display only the last page. Hope this helps.
Denodo Team
09-02-2017 22:42:15 -0500
This would work if I wasn't potentially working with a million rows. I'm using $count=100$startindex=0. If I'm on the first page, and I potentially have a million rows, how would I figure out how to jump to the last page? It would have terrible performance defects on my application if I was to retrieve the total # of records just for the sake of having the number. I'm using Restsharp to call the denodo REST api. I don't see a "Total number of rows in the resultset" anywhere in my request object.
user
13-02-2017 12:05:34 -0500
Hi, The solution that I provided in the last comment is the way to access the last page, getting the “Total number of rows in the resultset”. Regarding the performance issues that you commented, when it comes to querying more number of rows, it will affect performance and that is the reason why there is no direct option to go to the last page in a Rest Web Service. To be able achieve this in Denodo, the Virtual DataPort Server would need to get all rows first. That is not efficient way. The way Denodo works is returning only the needed information every time, so if you are in the first page, you will retrieve only the elements for the first page. If you need it you have the option to get the total number of rows and with that value you can easily navigate to the last page as I have mentioned in previous message. Assuming you want to see the latest records and that is the reason you want to jump to the last page, I can give you another workaround: You can order your results in descendant order to get the last rows in the first page. If you need, you can create a new column called rowid with function rownum() in Virtual DataPort. Then before publishing your view as a rest webservice, order by the view in descendant order, by your field or rowid. In this way you will get the latest records as your first page. Hope this helps.
Denodo Team
17-02-2017 08:59:51 -0500
You must sign in to add an answer. If you do not have an account, you can register here