guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GSoC: Adding a web interface similar to the Hydra web interface


From: Jelle Licht
Subject: Re: GSoC: Adding a web interface similar to the Hydra web interface
Date: Wed, 4 Jul 2018 23:47:14 +0200



2018-07-04 22:54 GMT+02:00 Tatiana Sholokhova <address@hidden>:
Hi all,


Hi Tatiana,
 
I just committed the code I wrote trying to improve pagination. I screwed up a bit with the new pagination. 
The problem I encountered is following. If we want to maintain a link to the previous page we have to filter the database table entries with to types of filters: one with lower bound on the id, and the other with the upper bound. As we do so simultaneously with limiting the query output to the maximal page size, we need to change the ordering type depending on the type of the filter. At the moment I am not sure, what it the best way to implement database query with such properties. Could you please take a look on the commit and share your ideas on that?

The current implementation of pagination works correctly but it does not support link to the previous page (first, and next only).

It has been some time since I last had a look at databases, so you have my apologies
in advance if what I am saying does not really apply, or is even not entirely correct.

You could perhaps have a look at reversing the sort order, and replace ">" with "<" and "<"
with "<" in your WHERE clauses. The query to the previous page would be similar to
retrieving the next page, but basically reversing the order you would page through the results,
if that makes any sense.

If this works, you could also hack together a maybe-efficient query to retrieve the items
for the last page; simply insert the maximum possible value in your query, and retrieve the
previous page with regards to that maximum value. In the current case, you could enter the
highest possible value any id can have.

If it is possible for new items to show up on previous pages as well (so with id's that are lower
than the highest id), you would need to replace your sorting and filtering to act on a composite
value of e.g. <id, timestamp>, instead of on only the id value.
 

I have been trying to improve pagination for a while, and I now am thinking about starting the parallel work on the implementation of the features we listed before. What do you think about it?

Best regards,
Tatiana

Good luck, and HTH!

- Jelle

reply via email to

[Prev in Thread] Current Thread [Next in Thread]