@@ -863,7 +863,9 @@ TDengine supports aggregations over data, they are listed below:
Applicable Fields: All types except timestamp.
Supported version: Version after 2.6.0 .
Note: Since the amount of returned data is unknown, considering the memory factor, in order to return the result normally, it is recommended that the amount of non repeated data is 100000, otherwise an error will be reported.
Example:
```mysql
taos> select voltage from d002;
...
...
@@ -886,7 +888,9 @@ TDengine supports aggregations over data, they are listed below:
```mysql
SELECT HYPERLOGLOG(field_name) FROM { tb_name | stb_name } [WHERE clause];
```
Function: The hyperloglog algorithm is used to return the cardinality of a column. In the case of large amount of data, the algorithm can significantly reduce the occupation of memory, but the cardinality is an estimated value, and the standard error is 0.81%.
Function:
- The hyperloglog algorithm is used to return the cardinality of a column. In the case of large amount of data, the algorithm can significantly reduce the occupation of memory, but the cardinality is an estimated value, and the standard error(the standard error is the standard deviation of the average of multiple experiments, not the error with the real result) is 0.81%.
- When the amount of data is small, the algorithm is not very accurate. You can use the method like this: select count(data) from (select unique(col) as data from table).
Return Data Type:Integer.
...
...
@@ -1215,8 +1219,10 @@ TDengine supports aggregations over data, they are listed below:
Supported version: Version after 2.6.0 .
Note: This function can be applied to ordinary tables and super tables. Cannot be used with window operations,such as interval/state_window/session_window.
Note:
- This function can be applied to ordinary tables and super tables. Cannot be used with window operations,such as interval/state_window/session_window.
- Since the amount of returned data is unknown, considering the memory factor, in order to return the result normally, it is recommended that the amount of non repeated data is 100000, otherwise an error will be reported.