TiDB Cloud Logo
TiDB LogoBack to labs
Time range
-- It is a particularly resource-intensive analytical query.
-- There is an event table with 109,950,743 rows of the same data in both MySQL and TiDB instances. 
SELECT (
      COUNT(CASE WHEN event_type = 'purchase' THEN 1 ELSE NULL END) /
      COUNT(CASE WHEN event_type = 'view' THEN 1 ELSE NULL END)
  ) AS bought_rate
FROM events
WHERE event_time >= '${start_time}'
    AND event_time <= '${end_time}'
MySQL RDS
your results will display here
TiDB Logo
TiDB Cloud Serverless
your results will display here

Copyright © PingCAP 2025.