Query option profileAll
profileAll will log profiling-related output during query execution. The output will contain executed joins etc. Note that the output format and detail granularity is evaluation-method specific.
@{q1, options[profileAll]} ?- ?X::?Y.