For RocksDB rocks-predicates, is add_to_clause_index/5 used with prefix seek?

In trying to understand the RocksDB code for WordNet example (wn.pl) came upon

add_to_clause_index/5

add_to_clause_index(DB, PI, Spec, _:Head, CRef), integer(Spec) =>
    arg(Spec, Head, Arg),
    term_hash(Arg, 1, 2147483647, Hash),
    assertion(nonvar(Hash)),            % TBD: variables in the head
    pred_index_key(PI, Spec, Hash, CRef, Key),
    rocks_put(DB, Key, 1).

Is this for use with RocksDB prefix seek?

rocks_enum/3 uses RocksDB prefix seek. And RocksDB compresses prefixes, so probably the hash isn’t needed. (I’m slowly working on modifying rocks_preds.pl, to simplify it and possibly make it faster, although it’s not clear how much faster it’ll end up … @jan - can you please send me your test wordnet file?)

1 Like

You might find this interesting.