# PFSELFTEST

> Run the built-in HyperLogLog self-test.

URL: https://docs.hotkv.com/commands/pfselftest/

```
PFSELFTEST
```

- Group: HyperLogLog
- HotKV Cloud: all plans
- On-Premise: no license needed

`PFSELFTEST` checks that the server's HyperLogLog implementation works: that
the sparse and dense representations agree and that estimates stay within the
expected error. It does not touch any keys. It is an administrative command,
useful after an upgrade or on unusual hardware.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| All checks passed | Simple string `OK` | Simple string `OK` |
| A check failed | Error starting with `ERR TESTFAILED` and a description | Error |

## Examples

```
127.0.0.1:6379> PFSELFTEST
OK
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[PFDEBUG](https://docs.hotkv.com/commands/pfdebug/index.md), [PFADD](https://docs.hotkv.com/commands/pfadd/index.md)