[Developers] Paging Results?
Alec Flett
alecf at metaweb.com
Thu Mar 22 15:54:40 UTC 2007
William Pietri wrote:
> John Giannandrea wrote:
>
>> yes, MQL supports cursors.
>> http://www.freebase.com/view/documentation/ch04.html#cursors
>>
>>
>
> And in case it helps, this is a little different than a normal cursor,
> where you grab it and keep pulling results from it.
>
>
The reason for this is that our "cursors" are stateless. The binary data
you get in the cursor is actually an encoding of the "position" of the
next item in the given query.
Minus a few bugs here and there, this means you can re-run the same
query with the same cursor over and over and keep getting the same
results back - I believe this will work even if the results change,
because the cursor should be recording the state of the graph when the
query was run. Think of it as kind of a 'bookmark' into the query results.
(At least for the next few months however, you shouldn't persist cursors
for longer than a few minutes - we have at least one pending change to
the cursor format that will render current cursors useless..)
Alec
> When you get your first set of MQL results, you get a pointer to the
> next set. In that next set, you will get a pointer to the following set.
> In the following set, you get yet another pointer. Just keep getting the
> pointer out of the new set to get to the next set and you'll be fine.
>
> Oh, and also unlike a normal cursor, it doesn't appear that you have to
> close or free up the cursor when you're done.
>
> William
>
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20070322/e4e378be/attachment-0002.htm
More information about the Developers
mailing list