Careful with tabling directive for ground calls?

Is this some ground call heuristic applied in tabling?
I see a predicate changing its behaviour with tabling:

/* SWI-Prolog 9.1.4 magic/2 not tabled */
?- magic(2, 0), fail; true.
2-0
1-0
0-0
0-0
1-9
1-16
1-3
true.

Now when I use the same code tabled I get. I expect
that 0-0 is not called twice, but otherwise all calls should happen?

/* SWI-Prolog 9.1.4 magic/2 tabled */
?- magic(2, 0), fail; true.
2-0
1-0
0-0
true.

Thats the code of the predicate. Since 1-19, 1-16 and 1-3 are
not called I guess the tabling cache will show poor recall:

% :- table magic/2.

magic(N, W) :- write(N-W), nl, fail.
magic(0, W) :- !, W = 0.
magic(N, W) :-
   M is N-1,
   H is 10^M,
   between(0, 9, D),
   U is W+D*H,
   (D = 0 -> V = U; V is U-D^D),
   V =< M*387420489,
   0 =< V+H-1,
   magic(M, V).

Maybe its onceing the call.

This seems to be even documented:

7.4 Tabling for impure programs

  • Early completion
    Ground goals, i.e., goals without variables, are subject to early completion. This implies they are considered completed after the first solution.

https://www.swi-prolog.org/pldoc/man?section=tnotpure

Oki Doki