[bknr-devel] Fwd: searching intervals, sorting and invalid-store-random-state signaled when opening a store

madnificent madnificent at gmail.com
Wed May 5 14:46:38 UTC 2010


Hello,


I just confirmed the bugfix Paul-Virak Khuong for SBCL.  I guess the
commit will make it through the next release of SBCL, you can playtest
it through clbuild.

With respect to the indices, can a skiplist return a range of objects?
 Or would it be best to do that by mapping over the objects in the
index?  (eg: show the posts for a particular user if there'd be an
index on post-date).  If there currently isn't anything like this:
Have you thought about this and found it useless or would it be a good
thing to have?  Have you thought about a syntax which you'd prefer for
sorted results?


thanks,

the madnificent

On Mon, Apr 26, 2010 at 11:13 AM, Hans Hübner <hans.huebner at gmail.com> wrote:
> On Mon, Apr 26, 2010 at 08:07,  <madnificent at gmail.com> wrote:
>> Searching Intervals:
>> Is there some sort of index or a common idiom to search for all objects in
>> which a specified property's value lies within a certain interval?  For
>> instance: listing/mapping over all widgets which have been created between
>> monday and wednesday.  Or all exams of a particular pupil which were scored
>> between 35 and 56.  Or should I create filters based on the index-mapvalues
>> and index-values?
>
> There is the skip-list-index which has been designed to deal with
> ranges and sparse integer valued slots.  The skip-list has a
> skip-list-range-cursor class that can be used to iterate over value
> ranges.  It is not exposed by the store itself, though, so you'll need
> to get the index instance from the class that you want to query and
> then call the skip-list-range-index gf on that object.
>
>> Sorting:
>> Does an index's index-reader (for instance a string-unique-index (but I'd
>> like to know for others as well)) guarantee something with respect to the
>> order in which the results are mapped/listed?  If not: is there some idiom
>> to receive a sorted list or should I create a custom index to limit the
>> amount of sorting?
>
> The order is determined by the underlying index, i.e. hash tables do
> not provide ordering, but array indices and skip lists do.
>
>> Condition Signaled:
>> Whenever I restart my lisp image in slime and open a previously used store,
>> I receive an invalid-store-random-state in SBCL 1.0.37.  Two meaningful
>> restarts are given, being initialize-store-random-state and
>> ignore-store-random-state.  Is there something obvious I'm doing wrong or is
>> this a bug of some sort?
>
> This is a bug, and I think I briefly saw it a few months ago but did
> not have the time to fix it.  As far as I remember, SBCL's random
> state can no longer be serialized/deserialized with read/write (see
> data/txn.lisp).  I'd welcome a patch.
>
> Thanks,
> Hans
>




More information about the Bknr-devel mailing list