This is essentially the same as calling COMMAND GETKEYS but provides a more efficient interface that can be used in every context (i.e. not a Redis command). (cherry picked from commit 9e58b52a19fed12c4e9fbe120ec0d4baf9c2bc28)