diff --git a/docs/yap.tex b/docs/yap.tex index ffe5e193f..db7c435c6 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -5045,13 +5045,22 @@ Defines the relation: @var{K} is a currently defined database key whose name is the atom @var{A}. It can be used to generate all the keys for the internal data-base. -@item key_statistics(+@var{K},-@var{Entries},-@var{Size}) -@findex key_properties/3 -@snindex key_properties/3 -@cnindex key_properties/3 +@item key_statistics(+@var{K},-@var{Entries},-@var{Size},-@var{IndexSize}) +@findex key_statistics/4 +@snindex key_statistics/4 +@cnindex key_statistics/4 Returns several statistics for a key @var{K}. Currently, it says how -many entries we have for that key, @var{Entries}, and what is the -total size spent on the key, @var{Size}. +many entries we have for that key, @var{Entries}, what is the +total size spent on entries, @var{Size}, and what is the amount of +space spent in indices. + +@item key_statistics(+@var{K},-@var{Entries},-@var{TotalSize}) +@findex key_statistics/3 +@snindex key_statistics/3 +@cnindex key_statistics/3 +Returns several statistics for a key @var{K}. Currently, it says how +many entries we have for that key, @var{Entries}, what is the +total size spent on this key. @item get_value(+@var{A},-@var{V}) @findex get_value/2 diff --git a/pl/utils.yap b/pl/utils.yap index 2850ecb5d..41149c1d7 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -478,7 +478,11 @@ statistics(stack_shifts,[NOfHO,NOfSO,NOfTO]) :- '$inform_stack_overflows'(NOfSO,_), '$inform_trail_overflows'(NOfTO,_). +key_statistics(Key, NOfEntries, TotalSize) :- + key_statistics(Key, NOfEntries, ClSize, IndxSize), + TotalSize is ClSize+IndxSize. + %%% The unknown predicate, % informs about what the user wants to be done when % there are no clauses for a certain predicate */