ORDER. Как можно оптимизировать выполнение?
SELECT
uniq(case when SNR_29 > 0 then mac_address end) as DS_SNR,
uniq(case when SDMH > 0 then mac_address end) as DS_Errors,
uniq(case when MER_19 > 0 then mac_address end) as US_SNR,
uniq(case when Power_48 > 0 then mac_address end) as US_TX_Power,
uniq(case when SDMH > 0 then mac_address end) as US_Errors
...
SELECT uniqIf(number, (number % 2) = 0) FROM numbers(1000000000) ┌─uniqIf(number, equals(modulo(number, 2), 0))─┐ │ 502375377 │ └──────────────────────────────────────────────┘ 1 rows in set. Elapsed: 3.539 sec. Processed 1.00 billion rows, 8.00 GB (282.55 million rows/s., 2.26 GB/s.) SELECT uniq(multiIf((number % 2) = 0, number, NULL)) FROM numbers(1000000000) ┌─uniq(multiIf(equals(modulo(number, 2), 0), number, NULL))─┐ │ 502375377 │ └───────────────────────────────────────────────────────────┘ 1 rows in set. Elapsed: 12.972 sec. Processed 1.00 billion rows, 8.00 GB (77.09 million rows/s., 616.72 MB/s.) ```
Обсуждают сегодня