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 7d117d7591656e947f526f5d5f8a022b88b38ad9)