pingcap / tiflash

The analytical engine for TiDB and TiDB Cloud. Try free: https://tidbcloud.com/free-trial
https://docs.pingcap.com/tidb/stable/tiflash-overview
Apache License 2.0
936 stars 409 forks source link

optimize logical operator function in TiFlash #9146

Open windtalker opened 3 weeks ago

windtalker commented 3 weeks ago

Enhancement

Running query

explain analyze select count(ol_i_id), count(ol_supply_w_id), count(ol_delivery_d) from order_line where ol_i_id <= 100000 and ol_supply_w_id <= 1500 and (ol_delivery_d >= "2021-12-27 09:25:34" or ol_delivery_d is NULL)

Where order_line has 452038522 rows, the profile shows logical operator is very slow in TiFlash(takes up almost 70% cpu time), which is not expected.

Screenshot 2024-06-13 at 16 10 56