In my experience, it does generate appropriate indexes. It’s easy to check – just do a query where the appropriate arguments are ground (it doesn’t matter whether the query succeeds or fails) and look at what jiti_list/1 tells you.
For example, here’s some set-up code I do on a 643,363 clauses, to create the indexes before starting the http server:
setup :-
concurrent_maplist(index_pred,
[kythe_node(sig,_,_,_,_,_,_), % kythe_node/7 1
kythe_node(_,_,_,path,_,_,value), % kythe_node/7 4+7
kythe_node(_,_,_,_,_,fact,value), % kythe_node/7 6+7
kythe_edge(sig,corpus,root,path,lang,_,_,_,_,_,_), % kythe_edge/11 1
kythe_edge(_,_,_,_,_,_,sig,corpus,root,path,lang), % kythe_edge/11 7
kythe_edge(_,_,_,_,_,lang,sig,corpus,root,path,lang), % kythe_edge/11 6
kythe_edge(vname(sig,corpus,root,path,lang),_,_), % kythe_edge/3 1
kythe_edge(_,_,vname(sig,corpus,root,path,lang)), % kythe_edge/3 1
kythe_edge(vname(sig,corpus,root,path,lang),edge,_),
kythe_edge(_,edge,vname(sig,corpus,root,path,lang)),
kythe_edge(_,edge,_),
kythe_color_line(corpus,root,path,lang,_,_), % kythe_color_line/6 3
kythe_color_line(corpus,root,path,lang,0,_) % kythe_color_line/6 3+5
])),
...
%! index_pred(:Goal) is nondet.
% Call a single Goal and ignore its result - this forces a building the index.
index_pred(Goal) :-
statistics(process_cputime, T0),
( Goal -> true ; true ),
statistics(process_cputime, T1),
T is T1 - T0,
debug(log, 'Indexed ~q in ~3f sec', [Goal, T]).
%! show_jiti is det.
show_jiti :-
strip_module(kythe_node(_,_,_), Module, _),
jiti_list(Module:_),
findall(S, kythe_node(S,_,_,_,_,_,_), Sigs),
length(Sigs, LenSigs),
sort(Sigs, SigsSorted),
length(SigsSorted, LenSigsSorted),
debug(log, 'kythe_node(Signature) in ~q: ~d entries, ~d unique.', [Module, LenSigs, LenSigsSorted]).
which wrote this to the log:
% [Thread 6 10:43:02] Indexed kythe_color_line(corpus,root,path,lang,_48,_50) in 0.694 sec
% [Thread 9 10:43:02] Indexed kythe_edge(_40,edge,_44) in 0.972 sec
% [Thread 15 10:43:02] Indexed kythe_color_line(corpus,root,path,lang,0,_50) in 1.026 sec
% [Thread 3 10:43:02] Indexed kythe_node(sig,_42,_44,_46,_48,_50,_52) in 1.276 sec
% [Thread 13 10:43:02] Indexed kythe_edge(vname(sig,corpus,root,path,lang),_42,_44) in 2.039 sec
% [Thread 5 10:43:02] Indexed kythe_edge(sig,corpus,root,path,lang,_50,_52,_54,_56,_58,_60) in 2.050 sec
% [Thread 10 10:43:02] Indexed kythe_edge(vname(sig,corpus,root,path,lang),edge,_44) in 2.320 sec
% [Thread 8 10:43:02] Indexed kythe_edge(_40,_42,vname(sig,corpus,root,path,lang)) in 2.430 sec
% [Thread 7 10:43:02] Indexed kythe_edge(_40,_42,_44,_46,_48,_50,sig,corpus,root,path,lang) in 2.433 sec
% [Thread 12 10:43:02] Indexed kythe_edge(_40,edge,vname(sig,corpus,root,path,lang)) in 2.524 sec
% [Thread 14 10:43:02] Indexed kythe_node(_40,_42,_44,_46,_48,fact,value) in 2.553 sec
% [Thread 11 10:43:02] Indexed kythe_edge(_40,_42,_44,_46,_48,lang,sig,corpus,root,path,lang) in 2.562 sec
% [Thread 4 10:43:02] Indexed kythe_node(_40,_42,_44,path,_48,_50,value) in 2.575 sec
Predicate Indexed Buckets Speedup Flags
============================================================================
src_browser:kythe_edge/11 1 131,072 11794.7
7 131,072 11794.7
6 16 5.2
src_browser:kythe_color_line/6 3+5 65,536 40332.0
3 256 45.7
src_browser:kythe_node/7 1 262,144 60698.5
4+7 262,144 4507.3
7 131,072 1090.0
% [Thread 1 10:43:03] kythe_node(Signature) in src_browser: 348365 entries, 136252 unique.
% [Thread 1 10:43:03] JIT index done.