This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FDS: Iterating through found records

In the documentation it says the order in which the records are returned is undefined. However in my observations FDS always appears to work upwards in terms of record_id so older records are returned first. Can I ask when is it the case that it is not this since from time to time I may have a record that may supersede an earlier record but I cannot use the FDS update function since there be '000s of records sharing the same file ID and record key? The record value contains another key that I can use to determine which one is the current one.

Many thanks in advance.

  • There are several things to consider, for instance:

    1. how many pages you are using
    2. how many times you have run GC
    3. the length of the records

    Internally, fds maps physical pages to so called virtual pages. The physical page to which a virtual page is mapped changes after GC. Because fds looks through pages using their virtual index, the order with which records are iterated does not change.

    It might happen though, that when one page is almost full (e.g. page A) and you attempt to write a new record, it will get written to another virtual page which has enough space instead (e.g. page B). If a smaller record is written afterwards, it will be written to page A if it fits.

    Then you'd have a situation where you'd iterate a more recent record before an older one. But once that order is estabilished, it does not change.

    emdi

Related