MySQL > select `table`, percentile_approx(cost_time,0.99)
from log_statis
group by `table`;
+----------+--------------------------------------+
| table | percentile_approx(`cost_time`, 0.99) |
+----------+--------------------------------------+
| test | 54.22 |
+----------+--------------------------------------+
MySQL > select `table`, percentile_approx(cost_time,0.99, 4096)
from log_statis
group by `table`;
+----------+----------------------------------------------+
| table | percentile_approx(`cost_time`, 0.99, 4096.0) |
+----------+----------------------------------------------+
| test | 54.21 |
+----------+----------------------------------------------+
MySQL > select percentile_approx(c2, [0.1, 0.5, 0.9], 10000) from t1;
+-----------------------------------------------+
| percentile_approx(c2, [0.1, 0.5, 0.9], 10000) |
+-----------------------------------------------+
| [4999.6005859375,25000,45000.3984375] |
+-----------------------------------------------+